mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Allow hotfix for dotted &filetype, fixes #46
This commit is contained in:
5
test/issues/46/Sample.jsx
Normal file
5
test/issues/46/Sample.jsx
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
const Sample = <Sample prop='highlight test'>
|
||||
some body
|
||||
</Sample>;
|
||||
|
||||
26
test/issues/46/minvimrc1
Normal file
26
test/issues/46/minvimrc1
Normal file
@@ -0,0 +1,26 @@
|
||||
set nocompatible
|
||||
|
||||
" load match-up
|
||||
let s:path = simplify(expand('<sfile>:h').'/../../..')
|
||||
let &rtp = s:path.',' . &rtp
|
||||
let &rtp .= ','.s:path.'/after'
|
||||
|
||||
autocmd FileType * echo &ft | sleep 1
|
||||
|
||||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'mxw/vim-jsx'
|
||||
Plug 'othree/yajs.vim'
|
||||
Plug 'othree/es.next.syntax.vim'
|
||||
call plug#end()
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
" match-up options go here
|
||||
function! JsxHotfix()
|
||||
echo 'JsxHotfix'
|
||||
setlocal matchpairs=(:),{:},[:],<:>
|
||||
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||
endfunction
|
||||
let g:matchup_hotfix = { 'javascript.jsx': 'JsxHotfix' }
|
||||
|
||||
26
test/issues/46/minvimrc2
Normal file
26
test/issues/46/minvimrc2
Normal file
@@ -0,0 +1,26 @@
|
||||
set nocompatible
|
||||
|
||||
" load match-up
|
||||
let s:path = simplify(expand('<sfile>:h').'/../../..')
|
||||
let &rtp = s:path.',' . &rtp
|
||||
let &rtp .= ','.s:path.'/after'
|
||||
|
||||
autocmd FileType * echo &ft | sleep 1
|
||||
|
||||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'mxw/vim-jsx'
|
||||
Plug 'othree/yajs.vim'
|
||||
Plug 'othree/es.next.syntax.vim'
|
||||
call plug#end()
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
" match-up options go here
|
||||
function! JsxHotfix()
|
||||
echo 'JsxHotfix'
|
||||
setlocal matchpairs=(:),{:},[:],<:>
|
||||
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||
endfunction
|
||||
autocmd FileType javascript.jsx let b:matchup_hotfix = 'JsxHotfix'
|
||||
|
||||
Reference in New Issue
Block a user