Skip to content

Commit e0655eb

Browse files
Fix clearing wrong autocmds
Previous to this fix, enabling autoformat-on-insert-leave for one buffer disables it for any other buffer that had it set. With this change enabling autoformat-on-insert-leave only impacts the buffer for which it is being run.
1 parent 157cfe8 commit e0655eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/clang_format.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ endfunction
262262

263263
function! clang_format#enable_format_on_insert() abort
264264
augroup plugin-clang-format-auto-format-insert
265-
autocmd!
265+
autocmd! * <buffer>
266266
autocmd InsertEnter <buffer> let s:pos_on_insertenter = getpos('.')
267267
autocmd InsertLeave <buffer> call s:format_inserted_area()
268268
augroup END

0 commit comments

Comments
 (0)