From 26f4d7930a68a7b14910fb6aed83f7db44bcf0e7 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 25 Jun 2016 15:46:22 -0400 Subject: Small code and documentation cleanup. --- modules/textadept/find.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 6b4efeee..30f9d0e3 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -200,6 +200,8 @@ local function find(text, next, flags, no_wrap, wrapped) end events.connect(events.FIND, find) +local incremental_start + -- Finds and selects text incrementally in the current buffer from a starting -- position. -- Flags other than `FIND_MATCHCASE` are ignored. @@ -209,10 +211,10 @@ events.connect(events.FIND, find) -- position. local function find_incremental(text, next, anchor) if anchor then - M._incremental_start = buffer:position_relative(buffer.current_pos, - next and 1 or -1) + incremental_start = buffer:position_relative(buffer.current_pos, + next and 1 or -1) end - buffer:goto_pos(M._incremental_start or 0) + buffer:goto_pos(incremental_start or 0) find(text, next, M.match_case and buffer.FIND_MATCHCASE or 0) end @@ -233,7 +235,7 @@ end -- @name find_incremental function M.find_incremental(text, next, anchor) if text then find_incremental(text, next, anchor) return end - M._incremental_start = buffer.current_pos + incremental_start = buffer.current_pos ui.command_entry:set_text('') ui.command_entry.enter_mode('find_incremental') end -- cgit v1.2.3