Fix html textobj adjustment

This commit is contained in:
Andy K. Massimino
2021-05-19 22:22:53 -04:00
parent f30d2d2d3a
commit 42e8ef032a
4 changed files with 7 additions and 13 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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