Fix bug when closing delimiter is at line end (#284) (#285)

This commit is contained in:
agguser
2019-11-28 13:29:20 +07:00
committed by Tim Pope
parent e4c4cc0f81
commit f51a26d371

View File

@@ -447,7 +447,7 @@ function! s:dosurround(...) " {{{1
let keeper = substitute(keeper,'^\s\+','','')
let keeper = substitute(keeper,'\s\+$','','')
endif
if col("']") == col("$") && col('.') + 1 == col('$')
if col("']") == col("$") && virtcol('.') + 1 == virtcol('$')
if oldhead =~# '^\s*$' && a:0 < 2
let keeper = substitute(keeper,'\%^\n'.oldhead.'\(\s*.\{-\}\)\n\s*\%$','\1','')
endif