From 28eca6d24fe1405da18ba1407356a3e58adfc823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Tue, 26 Jul 2016 12:34:59 +0200 Subject: [PATCH] Hack to ignore indentexpr during formatting (#436) --- indent/tex.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indent/tex.vim b/indent/tex.vim index b0a3c20..5c9536b 100644 --- a/indent/tex.vim +++ b/indent/tex.vim @@ -22,6 +22,15 @@ setlocal indentkeys& setlocal indentkeys+=[,(,{,),},],\&,=item function! VimtexIndent() " {{{1 + " + " It seems that there is a bug when indenting after formatting text, where + " for some reason, "getline(v:lnum)" does NOT get the current line, at least + " not as seen in the buffer. I did not find a good way of solving this, and + " so for now, I instead insist that the formatting operators, gw and gq, do + " not reindent lines. + " + if v:operator =~# 'g[wq]' | return -1 | endif + let l:nprev = s:get_prev_line(prevnonblank(v:lnum - 1)) if l:nprev == 0 | return 0 | endif