Minor code improvements

This commit is contained in:
Karl Yngve Lervåg 2015-03-20 21:36:17 +01:00
parent f8c41be09f
commit e12e73a3a0

View File

@ -85,7 +85,7 @@ function! vimtex#latexmk#callback(status) " {{{1
call vimtex#echo#status(['latexmk compile: ', call vimtex#echo#status(['latexmk compile: ',
\ a:status ? ['VimtexSuccess', 'success'] : ['VimtexWarning', 'fail']]) \ a:status ? ['VimtexSuccess', 'success'] : ['VimtexWarning', 'fail']])
return "" return ''
endfunction endfunction
" }}}1 " }}}1
@ -173,7 +173,7 @@ endfunction
function! vimtex#latexmk#compile_ss(verbose) " {{{1 function! vimtex#latexmk#compile_ss(verbose) " {{{1
let data = g:vimtex#data[b:vimtex.id] let data = g:vimtex#data[b:vimtex.id]
if data.pid if data.pid
call vimtex#echo#status(['latexmk compile: ' call vimtex#echo#status(['latexmk compile: ',
\ ['VimtexWarning', 'already running for `' . data.base . "'"]]) \ ['VimtexWarning', 'already running for `' . data.base . "'"]])
return return
endif endif
@ -297,7 +297,7 @@ function! vimtex#latexmk#status(detailed) " {{{1
let name = data.tex let name = data.tex
if len(name) >= winwidth('.') - 20 if len(name) >= winwidth('.') - 20
let name = "..." . name[-winwidth('.')+23:] let name = '...' . name[-winwidth('.')+23:]
endif endif
call vimtex#echo#status([ call vimtex#echo#status([
@ -447,7 +447,7 @@ endfunction
function! s:log_contains_error(logfile) " {{{1 function! s:log_contains_error(logfile) " {{{1
let lines = readfile(a:logfile) let lines = readfile(a:logfile)
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''') let lines = filter(lines, 'v:val =~# ''^.*:\d\+: ''')
let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')')) let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
let lines = map(lines, 'fnamemodify(v:val, '':p'')') let lines = map(lines, 'fnamemodify(v:val, '':p'')')
let lines = filter(lines, 'filereadable(v:val)') let lines = filter(lines, 'filereadable(v:val)')
@ -470,7 +470,7 @@ function! s:stop_buffer() " {{{1
" Count the number of buffers that point to current latex blob " Count the number of buffers that point to current latex blob
" "
let n = 0 let n = 0
for b in filter(range(1, bufnr("$")), 'buflisted(v:val)') for b in filter(range(1, bufnr('$')), 'buflisted(v:val)')
if id == getbufvar(b, 'vimtex', {'id' : -1}).id if id == getbufvar(b, 'vimtex', {'id' : -1}).id
let n += 1 let n += 1
endif endif