From 940732342827ebe0d3bb98740419f621f9c77391 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 26 Mar 2020 17:37:08 -0400 Subject: Switched to 1-based indices for buffer positions, lines, and countable entities. --- modules/lua/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/lua') diff --git a/modules/lua/init.lua b/modules/lua/init.lua index b9cf16bf..7a06b302 100644 --- a/modules/lua/init.lua +++ b/modules/lua/init.lua @@ -70,7 +70,7 @@ textadept.editing.autocompleters.lua = function() symbol, part = symbol:gsub('^_G%.?', ''), part ~= '_G' and part or '' -- Attempt to identify string type and file type symbols. local assignment = '%f[%w_]' .. symbol:gsub('(%p)', '%%%1') .. '%s*=%s*(.*)$' - for i = buffer:line_from_position(buffer.current_pos) - 1, 0, -1 do + for i = buffer:line_from_position(buffer.current_pos) - 1, 1, -1 do local expr = buffer:get_line(i):match(assignment) if expr then for patt, type in pairs(M.expr_types) do -- cgit v1.2.3