Skip to content

Commit c0bc801

Browse files
pgdouyonxuhdev
authored andcommitted
Use keeppatterns with substitute command
keeppatterns prevents the substitute command from modifying the search history which can cause unexpected behavior when using editorconfig with other plugins.
1 parent 4d88f6e commit c0bc801

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugin/editorconfig.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ function! s:TrimTrailingWhitespace() " {{{{
665665
" don't lose user position when trimming trailing whitespace
666666
let s:view = winsaveview()
667667
try
668-
silent! %s/\s\+$//e
668+
silent! keeppatterns %s/\s\+$//e
669669
finally
670670
call winrestview(s:view)
671671
endtry

0 commit comments

Comments
 (0)