Skip to content

Commit

Permalink
fix: adjust for selection=exclusive
Browse files Browse the repository at this point in the history
refer: #2368
  • Loading branch information
lervag committed Apr 25, 2022
1 parent 7bfcfb7 commit 5db1150
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/vimtex/text_obj.vim
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ function! vimtex#text_obj#delimited(is_inner, mode, type) abort " {{{1
call vimtex#pos#set_cursor(l:object.pos_start)
normal! o
call vimtex#pos#set_cursor(l:object.pos_end)

if &selection ==# 'exclusive'
normal! l
endif
endfunction

" }}}1
Expand Down
26 changes: 26 additions & 0 deletions test/test-textobj/test-exclusive.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
syntax on

set selection=exclusive

setfiletype tex

call vimtex#test#keys('f[did',
\ 'text [delim] other text',
\ 'text [] other text')

call vimtex#test#keys('f[dad',
\ 'text [delim] other text',
\ 'text other text')

call vimtex#test#keys('f$di$',
\ 'text $inline math$ other text',
\ 'text $$ other text')

call vimtex#test#keys('f$da$',
\ 'text $inline math$ other text',
\ 'text other text')

call vimtex#test#finished()

0 comments on commit 5db1150

Please sign in to comment.