diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-06 15:54:31 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-06 15:54:31 +0200 |
commit | 48e07bc5014fecfdff24f75124a65634c216c9e2 (patch) | |
tree | 2e16f9a515364e27ac451acbc313b1d7ca518790 /autoload/jsx_pretty | |
parent | c8897c9c18ee79d3780dd352aee34bf6498c625d (diff) | |
download | vim-polyglot-48e07bc5014fecfdff24f75124a65634c216c9e2.tar.gz vim-polyglot-48e07bc5014fecfdff24f75124a65634c216c9e2.zip |
Improve guard to support concatenated files
Diffstat (limited to 'autoload/jsx_pretty')
-rw-r--r-- | autoload/jsx_pretty/comment.vim | 6 | ||||
-rw-r--r-- | autoload/jsx_pretty/indent.vim | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/autoload/jsx_pretty/comment.vim b/autoload/jsx_pretty/comment.vim index 325baaea..932d5535 100644 --- a/autoload/jsx_pretty/comment.vim +++ b/autoload/jsx_pretty/comment.vim @@ -1,7 +1,4 @@ -if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) - finish -endif - +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) function! jsx_pretty#comment#update_commentstring(original) let syn_current = s:syn_name(line('.'), col('.')) let syn_start = s:syn_name(line('.'), 1) @@ -39,3 +36,4 @@ function! s:syn_contains(lnum, cnum, syn_name) let syn_names = map(stack, 'synIDattr(v:val, "name")') return index(syn_names, a:syn_name) >= 0 endfunction +endif diff --git a/autoload/jsx_pretty/indent.vim b/autoload/jsx_pretty/indent.vim index 67170b46..4c108416 100644 --- a/autoload/jsx_pretty/indent.vim +++ b/autoload/jsx_pretty/indent.vim @@ -1,7 +1,4 @@ -if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) - finish -endif - +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if exists('*shiftwidth') function! s:sw() return shiftwidth() @@ -216,3 +213,4 @@ function! jsx_pretty#indent#get(js_indent) endif endfunction +endif |