summaryrefslogtreecommitdiffstats
path: root/after/ftplugin/jsx.vim
diff options
context:
space:
mode:
Diffstat (limited to 'after/ftplugin/jsx.vim')
-rw-r--r--after/ftplugin/jsx.vim18
1 files changed, 13 insertions, 5 deletions
diff --git a/after/ftplugin/jsx.vim b/after/ftplugin/jsx.vim
index 12173822..e1d689aa 100644
--- a/after/ftplugin/jsx.vim
+++ b/after/ftplugin/jsx.vim
@@ -13,11 +13,19 @@ endif
" modified from html.vim
if exists("loaded_matchit")
let b:match_ignorecase = 0
- let s:jsx_match_words = '(:),\[:\],{:},<:>,' .
- \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
- let b:match_words = exists('b:match_words')
- \ ? b:match_words . ',' . s:jsx_match_words
- \ : s:jsx_match_words
+ let s:jsx_match_words = '<\([a-zA-Z0-9.]\+\)\(>\|$\|\s\):<\/\1>'
+
+ if !exists('b:loaded_jsx_match_words')
+ let b:loaded_jsx_match_words = 0
+ endif
+
+ if b:loaded_jsx_match_words == 0
+ let b:match_words = exists('b:match_words')
+ \ ? b:match_words . ',' . s:jsx_match_words
+ \ : s:jsx_match_words
+ endif
+
+ let b:loaded_jsx_match_words = 1
endif
setlocal suffixesadd+=.jsx