Make 'insert new command' work also after non-^ and non-\s regex (#596)

The insert new command functionality, mapped on `<F7>` 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].
This commit is contained in:
Enrico Maria De Angelis 2016-10-23 21:07:20 +02:00 committed by Karl Yngve Lervåg
parent c72fcbc0df
commit c68f5ca7c3

View File

@ -105,7 +105,7 @@ function! vimtex#cmd#delete() " {{{1
endfunction endfunction
function! vimtex#cmd#create() " {{{1 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:c0 = col('.') - (mode() ==# 'i')
let [l:l1, l:c1] = searchpos(l:re, 'bcn', line('.')) let [l:l1, l:c1] = searchpos(l:re, 'bcn', line('.'))