From f030d16ded4381d80d44a22f98d2d228f2e85f9f Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Tue, 31 Mar 2015 15:22:09 -0700 Subject: [PATCH] Added restoring cursor position after failed incremental search (#416). --- src/editor/findreplace.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editor/findreplace.lua b/src/editor/findreplace.lua index 5693fbe83e..2a4c0c1594 100644 --- a/src/editor/findreplace.lua +++ b/src/editor/findreplace.lua @@ -789,8 +789,9 @@ function findReplace:createPanel() mgr:Update() local editor = self:GetEditor() if editor then - -- restore original position for Shift-Esc - if event:ShiftDown() and findReplace.startpos then + -- restore original position for Shift-Esc or failed search + if findReplace.startpos + and (event:ShiftDown() or findReplace.foundString == false) then editor:GotoPos(findReplace.startpos) end editor:SetFocus()