From cbde2571d4f79770ac552fe75440de72893bc73a Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 25 Oct 2020 03:19:58 +0100 Subject: Respect symlinks for resolving vim-polyglot as fallback, closes #605 --- autoload/jsx_pretty/comment.vim | 9 +-------- autoload/jsx_pretty/indent.vim | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'autoload/jsx_pretty') diff --git a/autoload/jsx_pretty/comment.vim b/autoload/jsx_pretty/comment.vim index 5a9db367..44dbf803 100644 --- a/autoload/jsx_pretty/comment.vim +++ b/autoload/jsx_pretty/comment.vim @@ -1,11 +1,6 @@ -let s:base = expand(":h:h") -let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" } -let files = filter(globpath(&rtp, 'autoload/jsx_pretty/comment.vim', 1, 1), Filter) -if len(files) > 0 - exec 'source ' . files[0] +if !polyglot#util#IsEnabled('jsx', expand(':p')) finish endif -if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1) function! jsx_pretty#comment#update_commentstring(original) let line = getline(".") @@ -44,5 +39,3 @@ 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 34f88db0..3c5585a8 100644 --- a/autoload/jsx_pretty/indent.vim +++ b/autoload/jsx_pretty/indent.vim @@ -1,11 +1,6 @@ -let s:base = expand(":h:h") -let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" } -let files = filter(globpath(&rtp, 'autoload/jsx_pretty/indent.vim', 1, 1), Filter) -if len(files) > 0 - exec 'source ' . files[0] +if !polyglot#util#IsEnabled('jsx', expand(':p')) finish endif -if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1) if exists('*shiftwidth') function! s:sw() @@ -309,5 +304,3 @@ function! jsx_pretty#indent#get(js_indent) return a:js_indent() endfunction - -endif -- cgit v1.2.3