mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] fix FixWhitespaceOnSave flooding the search history
This commit is contained in:
parent
6dc39b0e04
commit
aed0b5a30e
1 changed files with 2 additions and 2 deletions
|
@ -144,9 +144,9 @@ nnoremap <silent><expr> <CR> empty(&buftype) ? ":write<bar>wall\<CR>" : "\<CR>"
|
|||
function s:FixWhitespaceOnSave()
|
||||
let l:pos = getpos('.')
|
||||
" remove trailing whitespace
|
||||
%s/\s\+$//e
|
||||
keeppatterns %s/\s\+$//e
|
||||
" remove trailing newlines
|
||||
%s/\($\n\s*\)\+\%$//e
|
||||
keeppatterns %s/\($\n\s*\)\+\%$//e
|
||||
call setpos('.', l:pos)
|
||||
endfunction
|
||||
" }}}
|
||||
|
|
Loading…
Reference in a new issue