mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix html textobj adjustment
This commit is contained in:
@@ -136,14 +136,7 @@ function! s:init_delim_lists(use_match_words) abort " {{{1
|
||||
" parse matchpairs and b:match_words
|
||||
let l:match_words = a:use_match_words ? get(b:, 'match_words', '') : ''
|
||||
if !empty(l:match_words) && l:match_words !~# ':'
|
||||
if a:0
|
||||
echohl ErrorMsg
|
||||
echo 'match-up: function b:match_words error'
|
||||
echohl None
|
||||
let l:match_words = ''
|
||||
else
|
||||
execute 'let l:match_words =' b:match_words
|
||||
endif
|
||||
execute 'let l:match_words =' b:match_words
|
||||
endif
|
||||
let l:simple = empty(l:match_words)
|
||||
|
||||
|
||||
@@ -722,6 +722,7 @@ function! s:populate_floating_win(offscreen) " {{{1
|
||||
" neovim floating win
|
||||
let width = max(map(copy(l:body), 'strdisplaywidth(v:val)'))
|
||||
if empty(a:offscreen.links.close.match)
|
||||
\ && a:offscreen.lnum > line('.')
|
||||
" include the closing hint
|
||||
let l:width += 3 + len(a:offscreen.links.open.match)
|
||||
endif
|
||||
|
||||
@@ -32,7 +32,7 @@ let s:htmllikeft = [
|
||||
\ 'tidy', 'php', 'liquid', 'haml', 'tt2html',
|
||||
\ 'html', 'xhtml', 'jsp', 'htmldjango',
|
||||
\ 'aspvbs', 'rmd', 'markdown', 'eruby',
|
||||
\ 'javascriptreact', 'typescriptreact',
|
||||
\ 'javascriptreact', 'typescriptreact', 'svelte'
|
||||
\]
|
||||
|
||||
" }}}1
|
||||
|
||||
@@ -128,8 +128,8 @@ function! matchup#text_obj#delimited(is_inner, visual, type) abort " {{{1
|
||||
|
||||
" make *i% more like *it for html
|
||||
if matchup#quirks#ishtmllike()
|
||||
\ && matchup#util#matchpref('classic_textobj', 1)
|
||||
\ && l:close.match =~? '/\w\+\s*>'
|
||||
\ && !matchup#util#matchpref('classic_textobj', 0)
|
||||
\ && l:close.match =~? '/\w\+\s*>\='
|
||||
let [l:l2, l:c2] = matchup#pos#prev(l:l2, l:c2)[1:2]
|
||||
endif
|
||||
|
||||
@@ -210,8 +210,8 @@ function! matchup#text_obj#delimited(is_inner, visual, type) abort " {{{1
|
||||
|
||||
" make *a% more like *at for html
|
||||
if matchup#quirks#ishtmllike()
|
||||
\ && matchup#util#matchpref('classic_textobj', 1)
|
||||
\ && l:close.match =~? '/\w\+\s*>'
|
||||
\ && !matchup#util#matchpref('classic_textobj', 0)
|
||||
\ && l:close.match =~? '/\w\+\s*>\='
|
||||
let l:c1 -= 1
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user