summaryrefslogtreecommitdiffstats
path: root/ftplugin/latex-box
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-01-23 21:09:23 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2015-01-23 21:09:23 +0100
commit6745c49110838db9ac39e85bbcf690b40bc20f83 (patch)
tree3b1c42f67bacb5ddb5b6afc5b4610f4c238877a7 /ftplugin/latex-box
parent1a97304cf642e9f887122e162b1999768b60c9d7 (diff)
downloadvim-polyglot-1.11.2.tar.gz
vim-polyglot-1.11.2.zip
Update all packagesv1.11.2
Diffstat (limited to 'ftplugin/latex-box')
-rw-r--r--ftplugin/latex-box/findmain.vim4
-rw-r--r--ftplugin/latex-box/latexmk.vim24
-rw-r--r--ftplugin/latex-box/mappings.vim32
3 files changed, 41 insertions, 19 deletions
diff --git a/ftplugin/latex-box/findmain.vim b/ftplugin/latex-box/findmain.vim
index 622c408f..b9871a61 100644
--- a/ftplugin/latex-box/findmain.vim
+++ b/ftplugin/latex-box/findmain.vim
@@ -30,7 +30,7 @@ function! LatexBox_GetMainFileName(...)
" move up the directory tree until we find a .latexmain file.
" TODO: Should we be doing this recursion by default, or should there be a
" setting?
- while glob('*.latexmain') == ''
+ while glob('*.latexmain',1) == ''
let dirmodifier = dirmodifier.':h'
let dirNew = fnameescape(expand(dirmodifier))
" break from the loop if we cannot go up any further.
@@ -41,7 +41,7 @@ function! LatexBox_GetMainFileName(...)
exe 'cd '.dirLast
endwhile
- let lheadfile = glob('*.latexmain')
+ let lheadfile = glob('*.latexmain',1)
if lheadfile != ''
" Remove the trailing .latexmain part of the filename... We never want
" that.
diff --git a/ftplugin/latex-box/latexmk.vim b/ftplugin/latex-box/latexmk.vim
index 6c5d3eb1..1285bc64 100644
--- a/ftplugin/latex-box/latexmk.vim
+++ b/ftplugin/latex-box/latexmk.vim
@@ -443,10 +443,32 @@ function! LatexBox_LatexErrors(status, ...)
endif
endfunction
+" Redefine uniq() for compatibility with older Vim versions (< 7.4.218)
+function! s:uniq(list)
+ if exists('*uniq')
+ return uniq(a:list)
+ elseif len(a:list) <= 1
+ return a:list
+ endif
+
+ let last_element = get(a:list,0)
+ let uniq_list = [last_element]
+
+ for i in range(1, len(a:list)-1)
+ let next_element = get(a:list, i)
+ if last_element == next_element
+ continue
+ endif
+ let last_element = next_element
+ call add(uniq_list, next_element)
+ endfor
+ return uniq_list
+endfunction
+
function! s:log_contains_error(file)
let lines = readfile(a:file)
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
- let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
+ let lines = s:uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
return len(lines) > 0
endfunction
diff --git a/ftplugin/latex-box/mappings.vim b/ftplugin/latex-box/mappings.vim
index 648d9b56..ef6b52ff 100644
--- a/ftplugin/latex-box/mappings.vim
+++ b/ftplugin/latex-box/mappings.vim
@@ -5,31 +5,31 @@ if exists("g:LatexBox_no_mappings")
endif
" latexmk {{{
-map <buffer> <LocalLeader>ll :Latexmk<CR>
-map <buffer> <LocalLeader>lL :Latexmk!<CR>
-map <buffer> <LocalLeader>lc :LatexmkClean<CR>
-map <buffer> <LocalLeader>lC :LatexmkClean!<CR>
-map <buffer> <LocalLeader>lg :LatexmkStatus<CR>
-map <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
-map <buffer> <LocalLeader>lk :LatexmkStop<CR>
-map <buffer> <LocalLeader>le :LatexErrors<CR>
+noremap <buffer> <LocalLeader>ll :Latexmk<CR>
+noremap <buffer> <LocalLeader>lL :Latexmk!<CR>
+noremap <buffer> <LocalLeader>lc :LatexmkClean<CR>
+noremap <buffer> <LocalLeader>lC :LatexmkClean!<CR>
+noremap <buffer> <LocalLeader>lg :LatexmkStatus<CR>
+noremap <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
+noremap <buffer> <LocalLeader>lk :LatexmkStop<CR>
+noremap <buffer> <LocalLeader>le :LatexErrors<CR>
" }}}
" View {{{
-map <buffer> <LocalLeader>lv :LatexView<CR>
+noremap <buffer> <LocalLeader>lv :LatexView<CR>
" }}}
" TOC {{{
-map <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
+noremap <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
" }}}
" List of labels {{{
-map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
+noremap <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
" }}}
" Folding {{{
if g:LatexBox_Folding == 1
- map <buffer> <LocalLeader>lf :LatexFold<CR>
+ noremap <buffer> <LocalLeader>lf :LatexFold<CR>
endif
" }}}
@@ -44,12 +44,12 @@ endif
" Define text objects {{{
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
-omap <buffer> ie :normal vie<CR>
-omap <buffer> ae :normal vae<CR>
+onoremap <buffer> ie :normal vie<CR>
+onoremap <buffer> ae :normal vae<CR>
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
-omap <buffer> i$ :normal vi$<CR>
-omap <buffer> a$ :normal va$<CR>
+onoremap <buffer> i$ :normal vi$<CR>
+onoremap <buffer> a$ :normal va$<CR>
" }}}
" Jump between sections {{{