Skip to content

Commit 979bf12

Browse files
committed
Merge pull request #7 from alerque/ondemand-loading
Make syntax injection compatable with Neovim
2 parents be5b047 + aa9c7bb commit 979bf12

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

plugin/criticmarkup.vim

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
augroup criticmarkup
2-
au! Filetype pandoc,markdown,mkd,txt call criticmarkup#Init()
3-
au! Syntax pandoc,markdown,mkd,txt call criticmarkup#InjectHighlighting()
2+
autocmd!
3+
autocmd Filetype pandoc,markdown,mkd,txt call criticmarkup#Init()
4+
autocmd Syntax pandoc,markdown,mkd,txt call criticmarkup#InjectHighlighting()
5+
" The unorthodox way this plugin injects new syntax rules is broken in
6+
" Neovim which takes a different approach to initializing the GUI (which
7+
" is an optional component rather than an assumed part of the system). As
8+
" a result we don't get initialized at all unless the user happens to
9+
" set filetype a second time after initial loading or loads a buffer after
10+
" the GUI is loaded. This hack sidesteps that and makes sure we get a
11+
" chance to get started. See https://github.com/neovim/neovim/issues/2953
12+
if has('nvim')
13+
autocmd VimEnter * doautoa Syntax,Filetype
14+
endif
415
augroup END

0 commit comments

Comments
 (0)