From 91f18298fb33acfbbf9c26bef71bd940ffccba80 Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 1 Oct 2021 16:11:48 -0400 Subject: Fixed uncommenting comments that are not initially aligned. --- modules/textadept/editing.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index c17d35e9..d115d1e1 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -360,10 +360,10 @@ function M.toggle_comment() buffer:begin_undo_action() for line = s, not ignore_last_line and e or e - 1 do local p = buffer.line_indent_position[line] - column = math.min(buffer.column[p], column) - p = buffer:find_column(line, column) local uncomment = buffer:text_range(p, p + #prefix) == prefix if not uncomment then + column = math.min(buffer.column[p], column) + p = buffer:find_column(line, column) buffer:insert_text(p, prefix) if suffix ~= '' then buffer:insert_text(buffer.line_end_position[line], suffix) end else -- cgit v1.2.3