From 213cb37d1d2571f26f970f4b4fff2ba6b0018797 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 22 May 2018 23:23:18 -0400 Subject: Fixed selection of find in files result if it's at the start of the line. --- modules/textadept/find.lua | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'modules/textadept/find.lua') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index c1a664c8..7a0a0d0c 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -113,15 +113,6 @@ local preferred_view -- @name find_in_files_filter M.find_in_files_filter = lfs.default_filter --- Text escape sequences with their associated characters and vice-versa. --- @class table --- @name escapes -local escapes = { - ['\\a'] = '\a', ['\\b'] = '\b', ['\\f'] = '\f', ['\\n'] = '\n', - ['\\r'] = '\r', ['\\t'] = '\t', ['\\v'] = '\v', ['\\\\'] = '\\' -} -for k, v in pairs(escapes) do escapes[v] = k end - -- Keep track of find text and found text so that "replace all" works as -- expected during a find session ("replace all" with selected text normally -- does "replace in selection"). @@ -416,7 +407,7 @@ function M.goto_file_found(line_num, next) if not utf8_filename then return end textadept.editing.select_line() pos = buffer.anchor + pos - 1 -- absolute position of result text on line - local s = buffer:indicator_end(M.INDIC_FIND, pos) + local s = buffer:indicator_end(M.INDIC_FIND, pos - 1) local e = buffer:indicator_end(M.INDIC_FIND, s + 1) if buffer:line_from_position(s) == buffer:line_from_position(pos) then s, e = s - pos, e - pos -- relative to line start -- cgit v1.2.3