aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <none@none>2021-10-01 16:11:48 -0400
committerGravatar mitchell <none@none>2021-10-01 16:11:48 -0400
commit91f18298fb33acfbbf9c26bef71bd940ffccba80 (patch)
treefcfe96ab3f5443b1ac9ec87925bce14451cb0e5f /modules
parent45bdbe2d13e5840c25dfadc27b49288ba486e729 (diff)
Fixed uncommenting comments that are not initially aligned.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua4
1 files changed, 2 insertions, 2 deletions
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