Skip to content

Commit d76b438

Browse files
committed
.
1 parent b19e9e6 commit d76b438

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin/markdown_extras.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ if use_prettier
5050
else
5151
augroup MARKDOWN_EXTRAS_PRETTIER_CHECK
5252
autocmd!
53-
autocmd BufReadPost *.md,*.markdown,*.mdown,*.mkd ++once
53+
# TODO: Changing BufReadPre with FileType markdown won't work because
54+
# FileType markdown autocmd is executed after ftplugin/markdown.vim is sourced,
55+
# and therefore ftplugin/markdown.vim would see use_prettier = true all
56+
# the time. Hence, the hack is to use BufReadPre and to specify all the
57+
# possible file extensions.
58+
autocmd BufReadPre *.md,*.markdown,*.mdown,*.mkd ++once
5459
\ PrettierInstalledCheck()
5560
augroup END
5661
endif

0 commit comments

Comments
 (0)