1
0
forked from aniani/vim

patch 9.1.1336: comment plugin does not support case-insensitive 'commentstring'

Problem:  comment plugin does not support case-insensitive
          'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
          (Maxim Kim)

fixes: #17184
closes: #17186

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Maxim Kim
2025-04-22 20:11:05 +02:00
committed by Christian Brabandt
parent 362be6ba27
commit dd776dd5f0
3 changed files with 31 additions and 5 deletions

View File

@@ -59,6 +59,29 @@ func Test_basic_uncomment()
call assert_equal(["# vim9script", "", "def Hello()", ' echo "Hello"', "enddef"], result)
endfunc
func Test_caseinsensitive_uncomment()
CheckScreendump
let lines =<< trim END
rem echo "Hello"
END
let input_file = "test_caseinsensitive_uncomment_input.bat"
call writefile(lines, input_file, "D")
let buf = RunVimInTerminal('-c "packadd comment" ' .. input_file, {})
call term_sendkeys(buf, "gcc")
let output_file = "comment_testinsensitive_uncomment_test.bat"
call term_sendkeys(buf, $":w {output_file}\<CR>")
defer delete(output_file)
call StopVimInTerminal(buf)
let result = readfile(output_file)
call assert_equal(['echo "Hello"'], result)
endfunc
func Test_bothends_comment()
CheckScreendump
let lines =<< trim END
@@ -551,6 +574,7 @@ func Test_textobj_last_line_empty_comment()
call assert_equal([], result)
endfunc
func Test_textobj_cursor_on_leading_space_comment()
CheckScreendump
let lines =<< trim END