From 48e07bc5014fecfdff24f75124a65634c216c9e2 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 6 Sep 2019 15:54:31 +0200 Subject: Improve guard to support concatenated files --- autoload/jsx_pretty/comment.vim | 6 ++---- autoload/jsx_pretty/indent.vim | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'autoload/jsx_pretty') 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 -- cgit v1.2.3