summaryrefslogtreecommitdiffstats
path: root/autoload/jsx_pretty
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-10-25 03:19:58 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2020-10-25 03:19:58 +0100
commitcbde2571d4f79770ac552fe75440de72893bc73a (patch)
treec6bf43ecbf9ed76071713dc4cba028d32695987a /autoload/jsx_pretty
parentd73c4d156279bfbc2ea9fafcbacca5fc2bd6cfd1 (diff)
downloadvim-polyglot-cbde2571d4f79770ac552fe75440de72893bc73a.tar.gz
vim-polyglot-cbde2571d4f79770ac552fe75440de72893bc73a.zip
Respect symlinks for resolving vim-polyglot as fallback, closes #605
Diffstat (limited to 'autoload/jsx_pretty')
-rw-r--r--autoload/jsx_pretty/comment.vim9
-rw-r--r--autoload/jsx_pretty/indent.vim9
2 files changed, 2 insertions, 16 deletions
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("<sfile>: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('<sfile>: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("<sfile>: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('<sfile>: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