Skip to content

Commit

Permalink
remove :undojoin to make undo point
Browse files Browse the repository at this point in the history
it can remove previous undo block hack.
but this makes cursor to top of the file on undo.
  • Loading branch information
rhysd committed Jan 8, 2017
1 parent 4475797 commit 5f8b884
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions autoload/clang_format.vim
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,8 @@ function! clang_format#replace(line1, line2)
throw 'fallback'
endif

" Create a new undo block to separate all formatting related
" changes from the last undo block but still preserve original
" cursor position (issue #30).
silent execute "noautocmd normal! ii\<esc>\"_x"

call setreg('g', formatted[i+1:], 'V')
undojoin | silent normal! 2gg"_dG
silent normal! 2gg"_dG
silent put g
catch
" Fallback:
Expand Down

0 comments on commit 5f8b884

Please sign in to comment.