Skip to content

Commit 5f8b884

Browse files
committed
remove :undojoin to make undo point
it can remove previous undo block hack. but this makes cursor to top of the file on undo.
1 parent 4475797 commit 5f8b884

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

autoload/clang_format.vim

+1-6
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,8 @@ function! clang_format#replace(line1, line2)
232232
throw 'fallback'
233233
endif
234234

235-
" Create a new undo block to separate all formatting related
236-
" changes from the last undo block but still preserve original
237-
" cursor position (issue #30).
238-
silent execute "noautocmd normal! ii\<esc>\"_x"
239-
240235
call setreg('g', formatted[i+1:], 'V')
241-
undojoin | silent normal! 2gg"_dG
236+
silent normal! 2gg"_dG
242237
silent put g
243238
catch
244239
" Fallback:

0 commit comments

Comments
 (0)