mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
FEATURE-1064: added CTRL+Backspace functionality.
This commit is contained in:
parent
fcab0a0f79
commit
9e2965d73e
1 changed files with 529 additions and 511 deletions
|
@ -493,6 +493,24 @@ namespace Greenshot.Drawing
|
||||||
HideTextBox();
|
HideTextBox();
|
||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added for FEATURE-1064
|
||||||
|
if (e.KeyCode == Keys.Back && e.Control)
|
||||||
|
{
|
||||||
|
e.SuppressKeyPress = true;
|
||||||
|
int selStart = _textBox.SelectionStart;
|
||||||
|
while (selStart > 0 && _textBox.Text.Substring(selStart - 1, 1) == " ")
|
||||||
|
{
|
||||||
|
selStart--;
|
||||||
|
}
|
||||||
|
int prevSpacePos = -1;
|
||||||
|
if (selStart != 0)
|
||||||
|
{
|
||||||
|
prevSpacePos = _textBox.Text.LastIndexOf(' ', selStart - 1);
|
||||||
|
}
|
||||||
|
_textBox.Select(prevSpacePos + 1, _textBox.SelectionStart - prevSpacePos - 1);
|
||||||
|
_textBox.SelectedText = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBox_LostFocus(object sender, EventArgs e)
|
private void textBox_LostFocus(object sender, EventArgs e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue