Skip to content

Use get() to check g:prettier#autoformat safely in ftplugin#217

Merged
mitermayer merged 1 commit intoprettier:masterfrom
hankchiutw:161-safe-condition-check-ftplugin
Nov 19, 2019
Merged

Use get() to check g:prettier#autoformat safely in ftplugin#217
mitermayer merged 1 commit intoprettier:masterfrom
hankchiutw:161-safe-condition-check-ftplugin

Conversation

@hankchiutw
Copy link
Copy Markdown
Contributor

Due to the fact that plugin will be loaded after ftplugin(http://vimdoc.sourceforge.net/htmldoc/filetype.html#ftplugin-overrule),
even we set g:prettier#autoformat in plugin/prettier.vim, it's treated as undefined in ftplugin/*.vim.

This happened when using vim-pathogen.

Due to the fact that `plugin` will be loaded after `ftplugin`(http://vimdoc.sourceforge.net/htmldoc/filetype.html#ftplugin-overrule),
even we set `g:prettier#autoformat` in plugin/prettier.vim, it's treated as undefined in ftplugin/*.vim.

This happened when using `vim-pathogen`.
@mitermayer
Copy link
Copy Markdown
Member

Thank you!

@mitermayer mitermayer merged commit 9eb448e into prettier:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants