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 --- after/indent/javascript.vim | 10 +++------- after/indent/jsx.vim | 6 ++---- after/indent/objc.vim | 6 ++---- after/indent/typescript.vim | 10 +++------- 4 files changed, 10 insertions(+), 22 deletions(-) (limited to 'after/indent') diff --git a/after/indent/javascript.vim b/after/indent/javascript.vim index 8c2254d6..90a94349 100644 --- a/after/indent/javascript.vim +++ b/after/indent/javascript.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) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Vim indent file " @@ -31,10 +28,8 @@ endfunction let &cpo = s:keepcpo unlet s:keepcpo -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1 - finish endif - +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'styled-components') == -1 " Vim syntax file " Language: styled-components (js/ts) " Maintainer: Karl Fleischmann @@ -204,3 +199,4 @@ fu! GetStyledIndent() " if all else fails indent according to C-syntax return cindent(v:lnum) endfu +endif diff --git a/after/indent/jsx.vim b/after/indent/jsx.vim index 3f25a7f1..ac4ceabd 100644 --- a/after/indent/jsx.vim +++ b/after/indent/jsx.vim @@ -1,5 +1,3 @@ -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1 - finish -endif - +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'styled-components') == -1 runtime! indent/javascript.vim +endif diff --git a/after/indent/objc.vim b/after/indent/objc.vim index 1bcc217a..9c64da42 100644 --- a/after/indent/objc.vim +++ b/after/indent/objc.vim @@ -1,7 +1,4 @@ -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'objc') != -1 - finish -endif - +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1 " Vim indent file " Language: Objective-C " Maintainer: Bjorn Winckler @@ -95,3 +92,4 @@ endfunction " Restore 'cpo' options let &cpo = s:save_cpo unlet s:save_cpo +endif diff --git a/after/indent/typescript.vim b/after/indent/typescript.vim index acc283f0..c7fbc225 100644 --- a/after/indent/typescript.vim +++ b/after/indent/typescript.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) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Vim indent file " @@ -32,8 +29,7 @@ endfunction let &cpo = s:keepcpo unlet s:keepcpo -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1 - finish endif - +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'styled-components') == -1 runtime! indent/javascript.vim +endif -- cgit v1.2.3