-
-
Notifications
You must be signed in to change notification settings - Fork 101
Fixes indent and adds g:vim_vue_indent_paths for runtime indent overrides #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ides (example usage {'javascript': '../vim-javascript/indent/javascript.vim'}. Docs need updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see what exactly is being fixed here.
execute 'runtime! indent/' . a:language . '.vim' | ||
let path = "" | ||
if exists('g:vim_vue_indent_paths') && has_key(g:vim_vue_indent_paths, a:language) | ||
let path = g:vim_vue_indent_paths[a:language] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent files from plugins are already loaded by default. Isn't this working for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me there were cases where you can have multiple plugins with indent rules. For example, eclim and vim-javascript both contain javascript rules, however vim-javascript is far superior for me. The old method always resulted in eclim loading for vue files.
The other suggested fixes for using set ft= html.javascript or vice-versa worked, but also broke completion and other plugins.
for language in s:languages | ||
let opening_tag_line = searchpair(language.pairs[0], '', language.pairs[1], 'bWr') | ||
|
||
if opening_tag_line | ||
execute 'let indent = ' . get(language, 'indentexpr', -1) | ||
let indent = language.indentexpr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get()
was being used here to return -1
(which means "do not change the indentation") when the indent file for that language is not present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I couldn't tell that this actually affected anything when I changed it-- tested it with missing indent files
Fixes indent and adds g:vim_vue_indent_paths for runtime indent overrides (example usage {'javascript': '../vim-javascript/indent/javascript.vim'}. Docs need updates.