From 155731041ae1889b471476006293a4a671dcf9f3 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 2 May 2019 16:45:48 -0400 Subject: Do not advance the caret on failed incremental find. --- modules/textadept/find.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index a86a990c..e356351a 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -167,6 +167,7 @@ local incremental_start -- @param anchor Flag indicating whether or not to search from the current -- position. local function find_incremental(text, next, anchor) + local orig_pos = buffer.current_pos if anchor then incremental_start = buffer:position_relative(buffer.current_pos, next and 1 or -1) @@ -176,6 +177,7 @@ local function find_incremental(text, next, anchor) -- default handler has one, so make use of it. events.emit(events.FIND, text, next, M.match_case and buffer.FIND_MATCHCASE or 0) + if buffer.selection_empty and anchor then buffer:goto_pos(orig_pos) end end --- -- cgit v1.2.3