From b8a5504021e0d21310bc603855ac8107828b5759 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 31 Dec 2019 14:05:09 +0100 Subject: Update --- after/indent/tsx.vim | 38 ++++++++++++++++++++++++++++++++++++++ after/indent/typescript.vim | 38 -------------------------------------- after/indent/typescriptreact.vim | 2 +- 3 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 after/indent/tsx.vim delete mode 100644 after/indent/typescript.vim (limited to 'after/indent') diff --git a/after/indent/tsx.vim b/after/indent/tsx.vim new file mode 100644 index 00000000..dd8ee271 --- /dev/null +++ b/after/indent/tsx.vim @@ -0,0 +1,38 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Vim indent file +" +" Language: typescript.jsx +" Maintainer: MaxMellon +" Depends: leafgarland/typescript-vim +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +if get(g:, 'vim_jsx_pretty_disable_tsx', 0) + finish +endif + +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('GetTypescriptIndent')) +endfunction + +let &cpo = s:keepcpo +unlet s:keepcpo + +endif diff --git a/after/indent/typescript.vim b/after/indent/typescript.vim deleted file mode 100644 index dd8ee271..00000000 --- a/after/indent/typescript.vim +++ /dev/null @@ -1,38 +0,0 @@ -if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vim indent file -" -" Language: typescript.jsx -" Maintainer: MaxMellon -" Depends: leafgarland/typescript-vim -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -if get(g:, 'vim_jsx_pretty_disable_tsx', 0) - finish -endif - -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('GetTypescriptIndent')) -endfunction - -let &cpo = s:keepcpo -unlet s:keepcpo - -endif diff --git a/after/indent/typescriptreact.vim b/after/indent/typescriptreact.vim index 931839b1..223f77c5 100644 --- a/after/indent/typescriptreact.vim +++ b/after/indent/typescriptreact.vim @@ -1,5 +1,5 @@ if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) -source :h/typescript.vim +source :h/tsx.vim endif -- cgit v1.2.3