Ref. #517: Use internal formatter for insert mode
This commit is contained in:
parent
326fd857a1
commit
a48df211a0
@ -41,6 +41,8 @@ endfunction
|
|||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
function! vimtex#format#formatexpr() " {{{1
|
function! vimtex#format#formatexpr() " {{{1
|
||||||
|
if mode() =~# '[iR]' | return -1 | endif
|
||||||
|
|
||||||
let l:foldenable = &l:foldenable
|
let l:foldenable = &l:foldenable
|
||||||
setlocal nofoldenable
|
setlocal nofoldenable
|
||||||
|
|
||||||
@ -69,11 +71,7 @@ function! vimtex#format#formatexpr() " {{{1
|
|||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
" Set cursor at appropriate position
|
" Set cursor at appropriate position
|
||||||
if mode() =~# '[iR]'
|
|
||||||
call cursor(l:bottom, col([l:bottom, '$']))
|
|
||||||
else
|
|
||||||
execute 'normal!' l:bottom . 'G^'
|
execute 'normal!' l:bottom . 'G^'
|
||||||
endif
|
|
||||||
|
|
||||||
" Don't change the text if the formatting algorithm failed
|
" Don't change the text if the formatting algorithm failed
|
||||||
if l:tries == 0
|
if l:tries == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user