From 6745c49110838db9ac39e85bbcf690b40bc20f83 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 23 Jan 2015 21:09:23 +0100 Subject: Update all packages --- ftplugin/latex-box/findmain.vim | 4 ++-- ftplugin/latex-box/latexmk.vim | 24 +++++++++++++++++++++++- ftplugin/latex-box/mappings.vim | 32 ++++++++++++++++---------------- 3 files changed, 41 insertions(+), 19 deletions(-) (limited to 'ftplugin/latex-box') 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 ll :Latexmk -map lL :Latexmk! -map lc :LatexmkClean -map lC :LatexmkClean! -map lg :LatexmkStatus -map lG :LatexmkStatus! -map lk :LatexmkStop -map le :LatexErrors +noremap ll :Latexmk +noremap lL :Latexmk! +noremap lc :LatexmkClean +noremap lC :LatexmkClean! +noremap lg :LatexmkStatus +noremap lG :LatexmkStatus! +noremap lk :LatexmkStop +noremap le :LatexErrors " }}} " View {{{ -map lv :LatexView +noremap lv :LatexView " }}} " TOC {{{ -map lt :LatexTOC +noremap lt :LatexTOC " }}} " List of labels {{{ -map lj :LatexLabels +noremap lj :LatexLabels " }}} " Folding {{{ if g:LatexBox_Folding == 1 - map lf :LatexFold + noremap lf :LatexFold endif " }}} @@ -44,12 +44,12 @@ endif " Define text objects {{{ vmap ie LatexBox_SelectCurrentEnvInner vmap ae LatexBox_SelectCurrentEnvOuter -omap ie :normal vie -omap ae :normal vae +onoremap ie :normal vie +onoremap ae :normal vae vmap i$ LatexBox_SelectInlineMathInner vmap a$ LatexBox_SelectInlineMathOuter -omap i$ :normal vi$ -omap a$ :normal va$ +onoremap i$ :normal vi$ +onoremap a$ :normal va$ " }}} " Jump between sections {{{ -- cgit v1.2.3