Skip to content

Commit

Permalink
Fix LT-21888: boundary marker name can be deleted when editing rules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 authored Sep 26, 2024
1 parent 7ae136b commit fe01516
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Src/LexText/LexTextControls/PatternView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
Expand Down Expand Up @@ -134,11 +134,16 @@ protected override void OnKeyDown(KeyEventArgs e)
/// <param name="e"></param>
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (e.KeyChar == (char) Keys.Back)
e.Handled = true;
if (e.KeyChar == (char)Keys.Back || e.KeyChar == (char)Keys.Delete)
{
if (RemoveItemsRequested != null)
RemoveItemsRequested(this, new RemoveItemsRequestedEventArgs(false));
e.Handled = true;
}
else
{
// Ignore all other characters (fixes LT-21888).
return;
}
base.OnKeyPress(e);
}
Expand Down

0 comments on commit fe01516

Please sign in to comment.