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/ansi_c/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/ansi_c') diff --git a/modules/ansi_c/init.lua b/modules/ansi_c/init.lua index e4be3710..688b81c3 100644 --- a/modules/ansi_c/init.lua +++ b/modules/ansi_c/init.lua @@ -41,7 +41,7 @@ textadept.editing.autocompleters.ansi_c = function() -- Attempt to identify the symbol type. if symbol ~= '' then local decl = '([%w_]+)[%s%*&]+' .. symbol:gsub('%p', '%%%0') .. '[^%w_]' - 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 class = buffer:get_line(i):match(decl) if class then symbol = class break end end -- cgit v1.2.3