From e87cd90dc09c2a203e13af9704bd0ef79303d755 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 31 Oct 2022 16:19:42 -0400 Subject: [PATCH] Fix nesting of closing comment on separate line Resolves: https://github.com/tpope/vim-commentary/issues/119 --- plugin/commentary.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/commentary.vim b/plugin/commentary.vim index da850a3..5370106 100644 --- a/plugin/commentary.vim +++ b/plugin/commentary.vim @@ -18,7 +18,7 @@ function! s:strip_white_space(l,r,line) abort if l[-1:] ==# ' ' && stridx(a:line,l) == -1 && stridx(a:line,l[0:-2]) == 0 let l = l[:-2] endif - if r[0] ==# ' ' && a:line[-strlen(r):] != r && a:line[1-strlen(r):] == r[1:] + if r[0] ==# ' ' && (' ' . a:line)[-strlen(r)-1:] != r && a:line[-strlen(r):] == r[1:] let r = r[1:] endif return [l, r]