patch 9.1.1456: comment plugin fails toggling if 'cms' contains \
Problem: comment plugin fails toggling if 'cms' contains \ Solution: escape backslash (Maxim Kim) groff could be commented using \" or \# and comment plugin fails to uncomment such things. NOTE: if newstyle comment would be introduced, e.g. .\# for groff test would need to be adjusted. closes: #17530 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
16e9b477ab
commit
532a5fb131
@ -1,7 +1,7 @@
|
||||
vim9script
|
||||
|
||||
# Maintainer: Maxim Kim <habamax@gmail.com>
|
||||
# Last Update: 2025-04-22
|
||||
# Last Update: 2025-06-12
|
||||
#
|
||||
# Toggle comments
|
||||
# Usage:
|
||||
@ -19,7 +19,7 @@ export def Toggle(...args: list<string>): string
|
||||
if empty(&cms) || !&ma | return '' | endif
|
||||
var cms = substitute(substitute(&cms, '\S\zs%s\s*', ' %s', ''), '%s\ze\S', '%s ', '')
|
||||
var [lnum1, lnum2] = [line("'["), line("']")]
|
||||
var cms_l = split(escape(cms, '*.'), '\s*%s\s*')
|
||||
var cms_l = split(escape(cms, '*.\'), '\s*%s\s*')
|
||||
|
||||
var first_col = indent(lnum1)
|
||||
var start_col = getpos("'[")[2] - 1
|
||||
|
||||
Reference in New Issue
Block a user