Fix 1 for #512: Use 79 when tw=0
This commit is contained in:
parent
1063e822d6
commit
665c895ace
@ -27,6 +27,8 @@ function! vimtex#format#init_script() " {{{1
|
|||||||
\ '%(begin|end)\{[^}]*\}',
|
\ '%(begin|end)\{[^}]*\}',
|
||||||
\ ], '|') . ')\s*$'
|
\ ], '|') . ')\s*$'
|
||||||
\ . '|^\s*%(\\\]|\$\$)\s*$'
|
\ . '|^\s*%(\\\]|\$\$)\s*$'
|
||||||
|
|
||||||
|
let s:textwidth = &l:textwidth == 0 ? 79 : &l:textwidth
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
@ -145,7 +147,7 @@ function! s:format_build_lines(start, end) " {{{1
|
|||||||
let l:lnum = a:start-1
|
let l:lnum = a:start-1
|
||||||
let l:current = repeat(' ', VimtexIndent(a:start))
|
let l:current = repeat(' ', VimtexIndent(a:start))
|
||||||
for l:word in l:words
|
for l:word in l:words
|
||||||
if len(l:word) + len(l:current) > &tw
|
if len(l:word) + len(l:current) > s:textwidth
|
||||||
call append(l:lnum, substitute(l:current, '\s$', '', ''))
|
call append(l:lnum, substitute(l:current, '\s$', '', ''))
|
||||||
let l:lnum += 1
|
let l:lnum += 1
|
||||||
let l:current = repeat(' ', VimtexIndent(a:start))
|
let l:current = repeat(' ', VimtexIndent(a:start))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user