From c68f5ca7c369b26d1b369c3829d257e0fd42369c Mon Sep 17 00:00:00 2001 From: Enrico Maria De Angelis Date: Sun, 23 Oct 2016 21:07:20 +0200 Subject: [PATCH] Make 'insert new command' work also after non-^ and non-\s regex (#596) The insert new command functionality, mapped on `` by default, doesn't work when the word is preceded by non-space and non-start-of-line character. This commit allows insertion after any non-letter, since LaTeX commands cannot contain other charaters than [a-zA-Z]. --- autoload/vimtex/cmd.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimtex/cmd.vim b/autoload/vimtex/cmd.vim index 9544319..79c5f9d 100644 --- a/autoload/vimtex/cmd.vim +++ b/autoload/vimtex/cmd.vim @@ -105,7 +105,7 @@ function! vimtex#cmd#delete() " {{{1 endfunction function! vimtex#cmd#create() " {{{1 - let l:re = '\v%(^|\s)\zs\w+\ze%(\s|$)' + let l:re = '\v%(^|\A)\zs\w+\ze%(\s|$)' let l:c0 = col('.') - (mode() ==# 'i') let [l:l1, l:c1] = searchpos(l:re, 'bcn', line('.'))