Optimize for text selection after pressing Win+R

This commit is contained in:
Yeechan Lu 2014-03-21 04:32:11 +08:00
parent 1281059076
commit 8a6690b6df

View File

@ -305,12 +305,14 @@ namespace Wox
private void OnWinRPressed() private void OnWinRPressed()
{ {
ShowWox(false); ShowWox(false);
if (tbQuery.Text != ">") if (!tbQuery.Text.StartsWith(">"))
{ {
resultCtrl.Clear(); resultCtrl.Clear();
ChangeQuery(">"); ChangeQuery(">");
} }
tbQuery.CaretIndex = tbQuery.Text.Length; tbQuery.CaretIndex = tbQuery.Text.Length;
tbQuery.SelectionStart = 1;
tbQuery.SelectionLength = tbQuery.Text.Length - 1;
} }
private void updateCmdMode() private void updateCmdMode()