Explorar o código

Don't add trailing whitespace to search history

Andrew Swistak %!s(int64=5) %!d(string=hai) anos
pai
achega
9f4d732004
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      vimrc

+ 2 - 2
vimrc

@@ -401,11 +401,11 @@ hi MatchParen ctermfg=160 ctermbg=NONE cterm=underline guifg=#df0000 guibg=NONE
 function! DeleteTrailingWS()
   if !exists('b:noStrip')
     exe "normal mz"
-    %s/\s\+$//ge
+    keepp %s/\s\+$//ge
     exe "normal `z"
   endif
 endfunction
-au BufWrite * :call DeleteTrailingWS()
+au BufWritePre * :call DeleteTrailingWS()
 au FileType go let b:noStrip=1
 
 if !has("nvim")