vim-signify icon indicating copy to clipboard operation
vim-signify copied to clipboard

Remove trailing white spaces on the changed lines

Open fenghse opened this issue 3 months ago • 1 comments

I am switching from vim-gitgutter to this new plugin, it is fast! Thanks.

But I am relying on following function to remove the trailing white spaces on the new added lines.

function! GlobalChangedLinesGutter(ex_cmd)
  for hunk in GitGutterGetHunks()
    for lnum in range(hunk[2], hunk[2]+hunk[3]-1)
      let cursor = getcurpos()
      silent! execute lnum.a:ex_cmd
      call setpos('.', cursor)
    endfor
  endfor
endfunction

command! -nargs=1 Glines call GlobalChangedLinesGutter(<q-args>)
autocmd BufWritePre * :Glines s/\s\+$//e

Is there equivalent API available from vim-signify to support this? Thanks.

fenghse avatar Mar 26 '24 17:03 fenghse