Kaynağa Gözat

Don't add trailing whitespace to search history

Andrew Swistak 5 yıl önce
ebeveyn
işleme
30476aa8fe
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      vimrc

+ 2 - 2
vimrc

@@ -390,11 +390,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
 
 " Allow the use of ALT as a function key.