FEATURE-1064: added CTRL+Backspace functionality.

This commit is contained in:
Krom, Robertus 2017-06-21 09:39:31 +02:00
commit 9e2965d73e

View file

@ -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)