File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ plugin author.
140140==============================================================================
141141CHANGELOG *context-commentstring-changelog*
142142
143+ 0.1.1 2014-06-06
144+ - Clear the autocommand always, in case the filetype is changed for
145+ whatever reason.
146+
1431470.1.0 2013-06-06
144148 - First public release.
145149
Original file line number Diff line number Diff line change 11" This file is part of vim-context_commentstring.
2- " Copyright: © 2013 Alejandro Exojo Piqueras <http://disperso.net/>
2+ " Copyright: © 2013-2014 Alejandro Exojo Piqueras <http://disperso.net/>
33" License: MIT (see doc for details).
44
55if exists (' g:loaded_context_commentstring' )
99
1010augroup ContextCommentstringBootstrap
1111 autocmd !
12- autocmd FileType * call <SID> Bootstrap ()
12+ autocmd FileType * call <SID> Setup ()
1313augroup END
1414
1515
16- function ! s: Bootstrap ()
17- if ! empty (&filetype ) && has_key (g: context #commentstring #table, &filetype )
18- let b: original_commentstring= &l: commentstring
19- augroup ContextCommentstringEnabled
20- autocmd !
16+ function ! s: Setup ()
17+ augroup ContextCommentstringEnabled
18+ " Clear previous autocommands first in all cases, in case the filetype
19+ " changed from something in the table, to something NOT in the table.
20+ autocmd ! CursorMoved <buffer>
21+ if ! empty (&filetype ) && has_key (g: context #commentstring #table, &filetype )
22+ let b: original_commentstring= &l: commentstring
2123 autocmd CursorMoved <buffer> call <SID> UpdateCommentString ()
22- augroup END
23- endif
24+ endif
25+ augroup END
2426endfunction
2527
2628
You can’t perform that action at this time.
0 commit comments