Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload/vimtex/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ endfunction
function! vimtex#cmd#create_insert() abort " {{{1
if mode() !=# 'i' | return | endif

let l:re = '\v%(^|\A)\zs\a+\ze%(\A|$)'
let l:re = '\v%(^|\A)\zs\a+(\*=)@>\a*\ze%(\A|$)'
let l:c0 = col('.') - 1

let [l:l1, l:c1] = searchpos(l:re, 'bcn', line('.'))
Expand Down
2 changes: 2 additions & 0 deletions test/test-commands/test-insert-cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ setfiletype tex

" F7 / Insert command (insert mode, normal mode and visual mode)
call vimtex#test#keys("lla\<f7>}", 'foobar', '\foo{bar}')
call vimtex#test#keys("llla\<f7>bar}", 'foo*', '\foo{bar}')
call vimtex#test#keys("llla\<f7>}", 'foo*bar', '\foo{bar}')
call vimtex#test#keys("fbve\<f7>emph\<cr>", 'foobar', 'foo\emph{bar}')
call vimtex#test#keys("\<f7>emph\<cr>", 'foo', '\emph{foo}')

Expand Down