Fix #544: Handle long lines while formatting
This commit is contained in:
parent
ec18d3b9a7
commit
be6d03b7cc
@ -110,6 +110,12 @@ function! s:format(top, bottom) " {{{1
|
||||
continue
|
||||
endif
|
||||
|
||||
" Handle long lines
|
||||
if len(l:line) > s:textwidth
|
||||
let l:bottom += s:format_build_lines(l:current, l:mark)
|
||||
let l:mark = l:current-1
|
||||
endif
|
||||
|
||||
if l:line =~# s:border_end
|
||||
if l:current < l:mark
|
||||
let l:bottom += s:format_build_lines(l:current+1, l:mark)
|
||||
|
@ -174,3 +174,29 @@ Expect tex (Verify):
|
||||
is an approximation whose coefficients become \emph{non-universal} (dependent
|
||||
on intial conditions) and \emph{time-dependent}.
|
||||
|
||||
Given tex (Format: Enumerate env):
|
||||
\begin{enumerate}[(i)]
|
||||
\item xxxxxxxxxx xx xxxxxx xxxxxx xx xxxxxxxxxx xxxxxxx xxxxxxx xxx
|
||||
xxxxxxxxxx xxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxx xxxx xxxxx xxxxxxxxxxx xxxxxxx
|
||||
xxxxxxxxxxxx xxxx xxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxxxx xxxxxxxxx xxxxxxxxx
|
||||
xx xxxxxxxxx
|
||||
\item xxxxxx xxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxx xxxxxxxxxxxxxx xxx
|
||||
xxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxx xxxxx xxxxxxx
|
||||
\end{enumerate}
|
||||
|
||||
Do (Format text):
|
||||
gqG
|
||||
|
||||
Expect tex (Verify):
|
||||
\begin{enumerate}[(i)]
|
||||
\item xxxxxxxxxx xx xxxxxx xxxxxx xx xxxxxxxxxx xxxxxxx xxxxxxx xxx
|
||||
xxxxxxxxxx xxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxx xxxx xxxxx xxxxxxxxxxx
|
||||
xxxxxxx xxxxxxxxxxxx xxxx xxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxxxx xxxxxxxxx
|
||||
xxxxxxxxx xx xxxxxxxxx
|
||||
\item xxxxxx xxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxx xxxxxxxxxxxxxx xxx
|
||||
xxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxx xxxxx xxxxxxx
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user