diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-10 10:30:32 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-10 10:30:32 +0200 |
commit | fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c (patch) | |
tree | 9b41186c43daaacf5b6d1cee71f8bde4dbc8edf2 /after/indent | |
parent | 19a69cf77d521d6f3856d2f5c1a2faa678b937ba (diff) | |
download | vim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.tar.gz vim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.zip |
Update
Diffstat (limited to 'after/indent')
-rw-r--r-- | after/indent/javascript.vim | 30 | ||||
-rw-r--r-- | after/indent/javascriptreact.vim | 2 | ||||
-rw-r--r-- | after/indent/jsx.vim | 33 |
3 files changed, 37 insertions, 28 deletions
diff --git a/after/indent/javascript.vim b/after/indent/javascript.vim index dd280edb..0add1da1 100644 --- a/after/indent/javascript.vim +++ b/after/indent/javascript.vim @@ -47,34 +47,10 @@ endfunction endif if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1) -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vim indent file -" -" Language: javascript.jsx -" Maintainer: MaxMellon <maxmellon1994@gmail.com> -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -if exists('b:did_indent') - let s:did_indent = b:did_indent - unlet b:did_indent -endif - -let s:keepcpo = &cpo -set cpo&vim - -if exists('s:did_indent') - let b:did_indent = s:did_indent +if get(g:, 'vim_jsx_pretty_disable_js', 0) + finish endif -setlocal indentexpr=GetJsxIndent() -setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ - -function! GetJsxIndent() - return jsx_pretty#indent#get(function('GetJavascriptIndent')) -endfunction - -let &cpo = s:keepcpo -unlet s:keepcpo +source <sfile>:h/jsx.vim endif diff --git a/after/indent/javascriptreact.vim b/after/indent/javascriptreact.vim index ab847072..265415d0 100644 --- a/after/indent/javascriptreact.vim +++ b/after/indent/javascriptreact.vim @@ -1,5 +1,5 @@ if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1) -source <sfile>:h/javascript.vim +source <sfile>:h/jsx.vim endif diff --git a/after/indent/jsx.vim b/after/indent/jsx.vim new file mode 100644 index 00000000..fcd7b5ad --- /dev/null +++ b/after/indent/jsx.vim @@ -0,0 +1,33 @@ +if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1) + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Vim indent file +" +" Language: javascript.jsx +" Maintainer: MaxMellon <maxmellon1994@gmail.com> +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +if exists('b:did_indent') + let s:did_indent = b:did_indent + unlet b:did_indent +endif + +let s:keepcpo = &cpo +set cpo&vim + +if exists('s:did_indent') + let b:did_indent = s:did_indent +endif + +setlocal indentexpr=GetJsxIndent() +setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ + +function! GetJsxIndent() + return jsx_pretty#indent#get(function('GetJavascriptIndent')) +endfunction + +let &cpo = s:keepcpo +unlet s:keepcpo + +endif |