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. --- test/test.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/test.lua') diff --git a/test/test.lua b/test/test.lua index 6356ee1c..9767eaa8 100644 --- a/test/test.lua +++ b/test/test.lua @@ -1788,6 +1788,28 @@ function test_editing_toggle_comment_lines() buffer:undo() -- comment buffer:undo() -- uncomment assert_equal(buffer:get_text(), text) -- verify atomic undo + -- LuaFormatter off + buffer:set_text(table.concat({ + '--foo', + ' --foo' + }, '\n')) + -- LuaFormatter on + offset = 2 + buffer:select_all() + textadept.editing.toggle_comment() + -- LuaFormatter off + assert_equal(buffer:get_text(), table.concat({ + 'foo', + ' foo' + }, '\n')) + -- LuaFormatter on + textadept.editing.toggle_comment() + -- LuaFormatter off + assert_equal(buffer:get_text(), table.concat({ + '--foo', + '-- foo' + }, '\n')) + -- LuaFormatter on buffer:close(true) end -- cgit v1.2.3