Make :s use more robust

This commit is contained in:
Tim Pope 2018-05-06 19:10:51 -04:00
parent dcecb762b0
commit b34083549e

View File

@ -2734,7 +2734,7 @@ function! s:BufReadObject() abort
if getline('.') ==# 'parent '
silent keepjumps delete_
else
silent keepjumps s/\%(^parent\)\@<! /\rparent /ge
silent exe 'keepjumps s/\m\C\%(^parent\)\@<! /\rparent /e' . (&gdefault ? '' : 'g')
endif
keepjumps let lnum = search('^encoding \%(<unknown>\)\=$','W',line('.')+3)
if lnum