diff -Nru vim-tlib-1.20/addon-info.json vim-tlib-1.23/addon-info.json --- vim-tlib-1.20/addon-info.json 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/addon-info.json 2017-03-16 19:32:34.000000000 +0000 @@ -5,5 +5,5 @@ "maintainer" : "Tom Link ", "repository" : {"type": "git", "url": "git://github.com/tomtom/tlib_vim.git"}, "dependencies" : {}, - "description" : "A library of vim functions" + "description" : "tlib -- A library of vim functions" } diff -Nru vim-tlib-1.20/autoload/tlib/agent.vim vim-tlib-1.23/autoload/tlib/agent.vim --- vim-tlib-1.20/autoload/tlib/agent.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/agent.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,7 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 328 - +" @Revision: 350 " :filedoc: " Various agents for use as key handlers in tlib#input#List() @@ -14,6 +13,7 @@ " General {{{1 function! tlib#agent#Exit(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if a:world.key_mode == 'default' call a:world.CloseScratch() let a:world.state = 'exit empty escape' @@ -29,6 +29,7 @@ function! tlib#agent#CopyItems(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let @* = join(a:selected, "\n") let a:world.state = 'redisplay' return a:world @@ -39,6 +40,7 @@ " InputList related {{{1 function! tlib#agent#PageUp(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.offset -= (winheight(0) / 2) let a:world.state = 'scroll' return a:world @@ -46,6 +48,7 @@ function! tlib#agent#PageDown(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.offset += (winheight(0) / 2) let a:world.state = 'scroll' return a:world @@ -53,6 +56,7 @@ function! tlib#agent#Home(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.prefidx = 1 let a:world.state = 'redisplay' return a:world @@ -60,6 +64,7 @@ function! tlib#agent#End(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.prefidx = len(a:world.list) let a:world.state = 'redisplay' return a:world @@ -68,6 +73,7 @@ function! tlib#agent#Up(world, selected, ...) "{{{3 TVarArg ['lines', 1] + Tlibtrace 'tlib', a:selected, lines let a:world.idx = '' if a:world.prefidx > lines let a:world.prefidx -= lines @@ -81,6 +87,7 @@ function! tlib#agent#Down(world, selected, ...) "{{{3 TVarArg ['lines', 1] + Tlibtrace 'tlib', a:selected, lines let a:world.idx = '' if a:world.prefidx <= (len(a:world.list) - lines) let a:world.prefidx += lines @@ -93,16 +100,19 @@ function! tlib#agent#UpN(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected return tlib#agent#Up(a:world, a:selected, g:tlib_scroll_lines) endf function! tlib#agent#DownN(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected return tlib#agent#Down(a:world, a:selected, g:tlib_scroll_lines) endf function! tlib#agent#ShiftLeft(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.offset_horizontal -= (winwidth(0) / 2) if a:world.offset_horizontal < 0 let a:world.offset_horizontal = 0 @@ -113,6 +123,7 @@ function! tlib#agent#ShiftRight(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.offset_horizontal += (winwidth(0) / 2) let a:world.state = 'display shift' return a:world @@ -120,12 +131,14 @@ function! tlib#agent#Reset(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.state = 'reset' return a:world endf function! tlib#agent#ToggleRestrictView(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if empty(a:world.filtered_items) return tlib#agent#RestrictView(a:world, a:selected) else @@ -135,11 +148,11 @@ function! tlib#agent#RestrictView(world, selected) "{{{3 - " TLogVAR a:selected + Tlibtrace 'tlib', a:selected let filtered_items = map(copy(a:selected), 'index(a:world.base, v:val) + 1') - " TLogVAR 1, filtered_items + Tlibtrace 'tlib', 1, filtered_items let filtered_items = filter(filtered_items, 'v:val > 0') - " TLogVAR 2, filtered_items + Tlibtrace 'tlib', 2, filtered_items if !empty(filtered_items) let a:world.filtered_items = filtered_items endif @@ -149,6 +162,7 @@ function! tlib#agent#UnrestrictView(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.filtered_items = [] let a:world.state = 'display' return a:world @@ -156,6 +170,7 @@ function! tlib#agent#Input(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let flt0 = a:world.CleanFilter(a:world.filter[0][0]) let flt1 = input('Filter: ', flt0) echo @@ -174,15 +189,16 @@ " Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the " original position in the parent window. function! tlib#agent#SuspendToParentWindow(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let world = a:world - let winnr = world.win_wnr - " TLogVAR winnr - if winnr != -1 + let wid = world.win_id + Tlibtrace 'tlib', wid + if wid != -1 let world = tlib#agent#Suspend(world, a:selected) if world.state =~ '\' call world.SwitchWindow('win') " let pos = world.cursor - " " TLogVAR pos + " Tlibtrace 'tlib', pos " if !empty(pos) " call setpos('.', pos) " endif @@ -200,17 +216,18 @@ " and will immediatly select the item under the cursor. " < will select the item but the window will remain opened. function! tlib#agent#Suspend(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if a:world.allow_suspend " TAssert IsNotEmpty(a:world.scratch) " TLogDBG bufnr('%') let br = tlib#buffer#Set(a:world.scratch) - " TLogVAR br, a:world.bufnr, a:world.scratch + Tlibtrace 'tlib', br, a:world.bufnr, a:world.scratch if bufnr('%') != a:world.scratch echohl WarningMsg echom "tlib#agent#Suspend: Internal error: Not a scratch buffer:" bufname('%') echohl NONE endif - " TLogVAR bufnr('%'), bufname('%'), a:world.scratch + Tlibtrace 'tlib', bufnr('%'), bufname('%'), a:world.scratch call tlib#autocmdgroup#Init() exec 'autocmd TLib BufEnter call tlib#input#Resume("world", 0, '. a:world.scratch .')' let b:tlib_world = a:world @@ -225,12 +242,14 @@ function! tlib#agent#Help(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.state = 'help' return a:world endf function! tlib#agent#OR(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:world.filter[0]) call insert(a:world.filter[0], '') endif @@ -240,6 +259,7 @@ function! tlib#agent#AND(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:world.filter[0]) call insert(a:world.filter, ['']) endif @@ -249,6 +269,7 @@ function! tlib#agent#ReduceFilter(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.ReduceFilter() let a:world.offset = 1 let a:world.state = 'display' @@ -257,6 +278,7 @@ function! tlib#agent#PopFilter(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.PopFilter() let a:world.offset = 1 let a:world.state = 'display' @@ -265,6 +287,7 @@ function! tlib#agent#Debug(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected " echo string(world.state) echo string(a:world.filter) echo string(a:world.idx) @@ -277,6 +300,7 @@ function! tlib#agent#Select(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.SelectItem('toggle', a:world.prefidx) " let a:world.state = 'display keepcursor' let a:world.state = 'redisplay' @@ -285,6 +309,7 @@ function! tlib#agent#SelectUp(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.SelectItem('toggle', a:world.prefidx) if a:world.prefidx > 1 let a:world.prefidx -= 1 @@ -295,6 +320,7 @@ function! tlib#agent#SelectDown(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.SelectItem('toggle', a:world.prefidx) if a:world.prefidx < len(a:world.list) let a:world.prefidx += 1 @@ -305,6 +331,7 @@ function! tlib#agent#SelectAll(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let listrange = range(1, len(a:world.list)) let mode = empty(filter(copy(listrange), 'index(a:world.sel_idx, a:world.GetBaseIdx(v:val)) == -1')) \ ? 'toggle' : 'set' @@ -317,6 +344,7 @@ function! tlib#agent#ToggleStickyList(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.sticky = !a:world.sticky let a:world.state = 'display keepcursor' return a:world @@ -327,11 +355,11 @@ " EditList related {{{1 function! tlib#agent#EditItem(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let lidx = a:world.prefidx - " TLogVAR lidx - " TLogVAR a:world.table + Tlibtrace 'tlib', lidx let bidx = a:world.GetBaseIdx(lidx) - " TLogVAR bidx + Tlibtrace 'tlib', bidx let item = a:world.GetBaseItem(bidx) let item = input(lidx .'@'. bidx .': ', item) if item != '' @@ -344,6 +372,7 @@ " Insert a new item below the current one. function! tlib#agent#NewItem(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let basepi = a:world.GetBaseIdx(a:world.prefidx) let item = input('New item: ') call insert(a:world.base, item, basepi) @@ -353,6 +382,7 @@ function! tlib#agent#DeleteItems(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let remove = copy(a:world.sel_idx) let basepi = a:world.GetBaseIdx(a:world.prefidx) if index(remove, basepi) == -1 @@ -370,12 +400,14 @@ function! tlib#agent#Cut(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let world = tlib#agent#Copy(a:world, a:selected) return tlib#agent#DeleteItems(world, a:selected) endf function! tlib#agent#Copy(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.clipboard = [] let bidxs = copy(a:world.sel_idx) call add(bidxs, a:world.GetBaseIdx(a:world.prefidx)) @@ -388,6 +420,7 @@ function! tlib#agent#Paste(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if has_key(a:world, 'clipboard') for e in reverse(copy(a:world.clipboard)) call insert(a:world.base, e, a:world.prefidx) @@ -400,6 +433,7 @@ function! tlib#agent#EditReturnValue(world, rv) "{{{3 + Tlibtrace 'tlib', a:rv return [a:world.state !~ '\', a:world.base] endf @@ -408,22 +442,15 @@ " Files related {{{1 function! tlib#agent#ViewFile(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:selected) let back = a:world.SwitchWindow('win') - " TLogVAR back + Tlibtrace 'tlib', back for filename in a:selected call tlib#file#Edit(filename) endfor - " if !&hidden && &l:modified - " let cmd0 = 'split' - " let cmd1 = 'sbuffer' - " else - " let cmd0 = 'edit' - " let cmd1 = 'buffer' - " endif - " call tlib#file#With(cmd0, cmd1, a:selected, a:world) - " TLogVAR &filetype - exec back + call a:world.SetOrigin(1) + silent! exec back let a:world.state = 'display' endif return a:world @@ -431,20 +458,39 @@ function! tlib#agent#EditFile(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected return tlib#agent#Exit(tlib#agent#ViewFile(a:world, a:selected), a:selected) endf +function! tlib#agent#EditFileInWindow(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected + if !empty(a:selected) + let back = a:world.SwitchWindow('win') + Tlibtrace 'tlib', back + for bufname in a:selected + let cmd = &modified && &nohidden ? 'sbuffer' : 'buffer' + exec cmd fnameescape(bufname) + endfor + " exec back + endif + return tlib#agent#Exit(a:world, a:selected) +endf + + function! tlib#agent#EditFileInSplit(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.CloseScratch() " call tlib#file#With('edit', 'buffer', a:selected[0:0], a:world) " call tlib#file#With('split', 'sbuffer', a:selected[1:-1], a:world) call tlib#file#With('split', 'sbuffer', a:selected, a:world) + call a:world.SetOrigin(1) return tlib#agent#Exit(a:world, a:selected) endf function! tlib#agent#EditFileInVSplit(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected call a:world.CloseScratch() " call tlib#file#With('edit', 'buffer', a:selected[0:0], a:world) " call tlib#file#With('vertical split', 'vertical sbuffer', a:selected[1:-1], a:world) @@ -453,19 +499,22 @@ if !empty(winpos) exec winpos endif + call a:world.SetOrigin(1) return tlib#agent#Exit(a:world, a:selected) endf function! tlib#agent#EditFileInTab(world, selected) "{{{3 - " TLogVAR a:selected + Tlibtrace 'tlib', a:selected call a:world.CloseScratch() call tlib#file#With('tabedit', 'tab sbuffer', a:selected, a:world) + call a:world.SetOrigin(1) return tlib#agent#Exit(a:world, a:selected) endf function! tlib#agent#ToggleScrollbind(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.scrollbind = get(a:world, 'scrollbind') ? 0 : 1 let a:world.state = 'redisplay' return a:world @@ -473,6 +522,7 @@ function! tlib#agent#ShowInfo(world, selected) + Tlibtrace 'tlib', a:selected let lines = [] for f in a:selected if filereadable(f) @@ -491,11 +541,14 @@ " Buffer related {{{1 function! tlib#agent#PreviewLine(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let l = a:selected[0] - let ww = winnr() - exec a:world.win_wnr .'wincmd w' + " let ww = winnr() + let wid = tlib#win#GetID() + call tlib#agent#SuspendToParentWindow(a:world, a:selected) call tlib#buffer#ViewLine(l, 1) - exec ww .'wincmd w' + call tlib#win#GotoID(wid) + " exec ww .'wincmd w' let a:world.state = 'redisplay' return a:world endf @@ -504,24 +557,12 @@ " If not called from the scratch, we assume/guess that we don't have to " suspend the input-evaluation loop. function! tlib#agent#GotoLine(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:selected) - - " let l = a:selected[0] - " " TLogVAR l - " let back = a:world.SwitchWindow('win') - " " TLogVAR back - " " if a:world.win_wnr != winnr() - " " let world = tlib#agent#Suspend(a:world, a:selected) - " " exec a:world.win_wnr .'wincmd w' - " " endif - " call tlib#buffer#ViewLine(l) - " exec back - " let a:world.state = 'display' - let l = a:selected[0] - if a:world.win_wnr != winnr() + if a:world.win_id != tlib#win#GetID() let world = tlib#agent#Suspend(a:world, a:selected) - exec a:world.win_wnr .'wincmd w' + call tlib#win#GotoID(a:world.win_id) endif call tlib#buffer#ViewLine(l, 1) @@ -531,6 +572,7 @@ function! tlib#agent#DoAtLine(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:selected) let cmd = input('Command: ', '', 'command') if !empty(cmd) @@ -552,6 +594,7 @@ function! tlib#agent#Wildcard(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected if !empty(a:world.filter[0]) let rx_type = a:world.matcher.FilterRxPrefix() let flt0 = a:world.CleanFilter(a:world.filter[0][0]) @@ -568,12 +611,14 @@ function! tlib#agent#Null(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let a:world.state = 'redisplay' return a:world endf function! tlib#agent#ExecAgentByName(world, selected) "{{{3 + Tlibtrace 'tlib', a:selected let s:agent_names_world = a:world let agent_names = {'Help': 'tlib#agent#Help'} for def in values(a:world.key_map[a:world.key_mode]) @@ -583,11 +628,11 @@ endfor let s:agent_names = sort(keys(agent_names)) let command = input('Command: ', '', 'customlist,tlib#agent#CompleteAgentNames') - " TLogVAR command + Tlibtrace 'tlib', command if !has_key(agent_names, command) - " TLogVAR command + Tlibtrace 'tlib', command silent! let matches = filter(keys(agent_names), 'v:val =~ command') - " TLogVAR matches + Tlibtrace 'tlib', matches if len(matches) == 1 let command = matches[0] endif @@ -609,43 +654,45 @@ function! tlib#agent#CompleteAgentNames(ArgLead, CmdLine, CursorPos) - return filter(copy(s:agent_names), 'stridx(v:val, a:ArgLead) != -1') + let arglead = tolower(a:Arglead) + return filter(copy(s:agent_names), 'stridx(tolower(v:val), arglead) != -1') endf function! tlib#agent#Complete(world, selected) abort "{{{3 + Tlibtrace 'tlib', a:selected let rxprefix = a:world.matcher.FilterRxPrefix() let flt = a:world.filter[0][0] - " TLogVAR flt + Tlibtrace 'tlib', flt let fltrx = rxprefix . flt . '\m[^[:space:][:cntrl:][:punct:]<>*+?&~{}()\[\]\\/]\+' let fltrx0 = '\m^' . fltrx - " TLogVAR fltrx, fltrx0 + Tlibtrace 'tlib', fltrx, fltrx0 let words = {} for item in a:world.list let parts = split(item, '\ze'. fltrx) - " TLogVAR item, parts + Tlibtrace 'tlib', item, parts for part in parts let word = matchstr(part, fltrx0) - " TLogVAR part, word + Tlibtrace 'tlib', part, word if !empty(word) let words[word] = 1 endif endfor endfor - " TLogVAR keys(words) + Tlibtrace 'tlib', keys(words) let completions = keys(words) " let completions = filter(keys(words), 'matchstr(v:val, fltrx0)') let completions = sort(completions, 's:SortCompletions') let completions = tlib#list#Uniq(completions) - " TLogVAR 0, completions + Tlibtrace 'tlib', 0, completions while len(completions) > 1 let nchar = strwidth(completions[0]) - 1 let completions = map(completions, 'strpart(v:val, 0, nchar)') - " TLogVAR 'reduce', completions + Tlibtrace 'tlib', 'reduce', completions let completions = tlib#list#Uniq(completions) - " TLogVAR 'unique', len(completions), completions + Tlibtrace 'tlib', 'unique', len(completions), completions endwh - " TLogVAR 9, completions + Tlibtrace 'tlib', 9, completions if empty(completions) let a:world.state = 'redisplay update' else diff -Nru vim-tlib-1.20/autoload/tlib/arg.vim vim-tlib-1.23/autoload/tlib/arg.vim --- vim-tlib-1.20/autoload/tlib/arg.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/arg.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,8 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2015-11-24. -" @Revision: 258 +" @Last Change: 2017-03-07. +" @Revision: 272 " :def: function! tlib#arg#Get(n, var, ?default="", ?test='') @@ -92,30 +92,34 @@ " ['-ab', '--', '--foo', '--bar=BAR'] " => {'a': 1, 'b': 1, '__rest__': ['--foo', '--bar=BAR']} function! tlib#arg#GetOpts(args, ...) abort "{{{3 - let throw = a:0 == 0 - TVarArg ['def', {}] - " TLogVAR def - let opts = {'__exit__': 0} - for [key, vdef] in items(get(def, 'values', {})) - if has_key(vdef, 'default') - let opts[key] = vdef.default - endif - endfor - let idx = 0 - for o in a:args - let [break, idx] = s:SetOpt(def, opts, idx, o) - if break == 1 - break - elseif break == 2 - if throw - throw 'tlib#arg#GetOpts: Show help' - else - let opts.__exit__ = 5 + if type(a:args) == 4 + reutrn a:args + else + let throw = a:0 == 0 + TVarArg ['def', {}] + " TLogVAR def + let opts = {'__exit__': 0} + for [key, vdef] in items(get(def, 'values', {})) + if has_key(vdef, 'default') + let opts[key] = vdef.default endif - endif - endfor - let opts.__rest__ = a:args[idx : -1] - return opts + endfor + let idx = 0 + for o in a:args + let [break, idx] = s:SetOpt(def, opts, idx, o) + if break == 1 + break + elseif break == 2 + if throw + throw 'tlib#arg#GetOpts: Show help' + else + let opts.__exit__ = 5 + endif + endif + endfor + let opts.__rest__ = a:args[idx : -1] + return opts + endif endf @@ -147,7 +151,7 @@ let default = get(vdef, 'default', '') let type = s:GetValueType(vdef) if default =~ '^-\?\d\+\%(\.\d\+\)$' - if type == -1 + if type == -1 || type == 6 let opt .= ' (flag)' elseif type == 1 let opt .= '=INT' @@ -171,6 +175,11 @@ endif endif let break = 2 + elseif long && a:opt =~# '^--\%(no-\)\?debug$' + if has_key(a:def, 'trace') + let mod = a:opt =~# '--no-' ? '-' : '+' + exec 'Tlibtraceset' mod . a:def.trace + endif elseif long && a:opt =~# '^--no-.\+' let key = matchstr(a:opt, '^--no-\zs.\+$') let a:opts[key] = s:Validate(a:def, key, 0) @@ -296,6 +305,9 @@ endif let cs['-'. name] = 1 endfor + if has_key(a:def, 'trace') + let cs['--debug'] = 1 + endif let nchar = len(a:ArgLead) if nchar > 0 call filter(cs, 'strpart(v:key, 0, nchar) ==# a:ArgLead') diff -Nru vim-tlib-1.20/autoload/tlib/assert.vim vim-tlib-1.23/autoload/tlib/assert.vim --- vim-tlib-1.20/autoload/tlib/assert.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/assert.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,8 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: https://github.com/tomtom " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2015-12-04 -" @Revision: 41 +" @Last Change: 2017-02-22 +" @Revision: 42 " Enable tracing via |:Tlibassert|. diff -Nru vim-tlib-1.20/autoload/tlib/cache.vim vim-tlib-1.23/autoload/tlib/cache.vim --- vim-tlib-1.20/autoload/tlib/cache.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/cache.vim 2017-03-16 19:32:34.000000000 +0000 @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-30. -" @Last Change: 2015-11-26. -" @Revision: 35.1.243 +" @Last Change: 2017-03-06. +" @Revision: 89.1.243 " The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'. @@ -60,6 +60,14 @@ endf +" :display: tlib#cache#EncodedFilename(type, file, ?mkdir=0, ?dir='') +" Encode `file` and call |tlib#cache#Filename()|. +function! tlib#cache#EncodedFilename(type, file, ...) "{{{3 + let file = tlib#url#Encode(a:file) + return call(function('tlib#cache#Filename'), [a:type, file] + a:000) +endf + + " :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='') function! tlib#cache#Filename(type, ...) "{{{3 " TLogDBG 'bufname='. bufname('.') @@ -90,12 +98,15 @@ " TLogVAR file, dir, mkdir let cache_file = tlib#file#Join([dir, file]) if len(cache_file) > g:tlib#cache#max_filename + " echom "DBG long filename" cache_file + " echom "DBG long filename" dir if v:version >= 704 - let shortfilename = pathshorten(file) .'_'. sha256(file) + let shortfilename = sha256(file) else - let shortfilename = pathshorten(file) .'_'. tlib#hash#Adler32(file) + let shortfilename = tlib#hash#Adler32(file) endif - let cache_file = tlib#cache#Filename(a:type, shortfilename, mkdir, dir0) + " let cache_file = tlib#cache#Filename(a:type, shortfilename, mkdir, dir0) + let cache_file = tlib#file#Join([dir, shortfilename]) else if mkdir && !isdirectory(dir) try @@ -126,15 +137,32 @@ endf -function! tlib#cache#Save(cfile, dictionary, ...) "{{{3 +function! s:PutValue(cfile, value) abort "{{{3 + let s:cache[a:cfile] = {'mtime': localtime(), 'data': a:value} +endf + + +function! s:GetValue(cfile, default) abort "{{{3 + return get(get(s:cache, a:cfile, {}), 'data', a:default) +endf + + +function! s:GetCacheTime(cfile) abort "{{{3 + let not_found = !has_key(s:cache, a:cfile) + let cftime = not_found ? -1 : s:cache[a:cfile].mtime + return cftime +endf + + +function! tlib#cache#Save(cfile, value, ...) "{{{3 TVarArg ['options', {}] let in_memory = get(options, 'in_memory', 0) if in_memory " TLogVAR in_memory, a:cfile, localtime() - let s:cache[a:cfile] = {'mtime': localtime(), 'data': a:dictionary} + call s:PutValue(a:cfile, a:value) elseif !empty(a:cfile) - " TLogVAR a:dictionary - call writefile([string(a:dictionary)], a:cfile, 'b') + " TLogVAR a:value + call writefile([string(a:value)], a:cfile, 'b') call s:SetTimestamp(a:cfile, 'write') endif endf @@ -152,16 +180,23 @@ let in_memory = get(options, 'in_memory', 0) if in_memory " TLogVAR in_memory, a:cfile - return get(get(s:cache, a:cfile, {}), 'data', default) + return s:GetValue(a:cfile, default) else call tlib#cache#MaybePurge() - if !empty(a:cfile) && filereadable(a:cfile) - let val = readfile(a:cfile, 'b') - call s:SetTimestamp(a:cfile, 'read') - return eval(join(val, "\n")) - else - return default + if !empty(a:cfile) + let mt = s:GetCacheTime(a:cfile) + let ft = getftime(a:cfile) + if mt != -1 && mt >= ft + return s:GetValue(a:cfile, default) + elseif ft != -1 + let val = readfile(a:cfile, 'b') + call s:SetTimestamp(a:cfile, 'read') + let value = eval(join(val, "\n")) + call s:PutValue(a:cfile, value) + return value + endif endif + return default endif endf @@ -173,13 +208,13 @@ TVarArg ['args', []], ['options', {}] let in_memory = get(options, 'in_memory', 0) if in_memory - let not_found = !has_key(s:cache, a:cfile) - let cftime = not_found ? -1 : s:cache[a:cfile].mtime + let cftime = s:GetCacheTime(a:cfile) else let cftime = getftime(a:cfile) endif + let ftime = a:ftime " TLogVAR in_memory, cftime - if cftime == -1 || (a:ftime != 0 && cftime < a:ftime) + if cftime == -1 || ftime == -1 || (ftime != 0 && cftime < ftime) " TLogVAR a:generator, args let val = call(a:generator, args) " TLogVAR val @@ -198,6 +233,12 @@ endf +function! tlib#cache#ValueFromName(type, name, ...) abort "{{{3 + let cfile = tlib#cache#Filename(a:type, tlib#url#Encode(a:name), 1) + return call(function('tlib#cache#Value'), [cfile] + a:000) +endf + + " Call |tlib#cache#Purge()| if the last purge was done before " |g:tlib#cache#purge_every_days|. function! tlib#cache#MaybePurge() "{{{3 @@ -260,11 +301,7 @@ endif else if getftime(file) < threshold - if delete(file) - call add(msg, "TLib: Could not delete cache file: ". file) - elseif g:tlib#cache#verbosity >= 2 - call add(msg, "TLib: Delete cache file: ". file) - endif + call s:Delete(msg, file, '') else call add(newer, file) endif @@ -277,56 +314,68 @@ echo join(msg, "\n") endif if !empty(deldir) - if &shell =~ 'sh\(\.exe\)\?$' - let scriptfile = 'deldir.sh' - let rmdir = 'rm -rf %s' - else - let scriptfile = 'deldir.bat' - let rmdir = 'rmdir /S /Q %s' - endif - let enc = g:tlib#cache#script_encoding - if has('multi_byte') && enc != &enc - call map(deldir, 'iconv(v:val, &enc, enc)') - endif - let scriptfile = tlib#file#Join([dir, scriptfile]) - if filereadable(scriptfile) - let script = readfile(scriptfile) - else - let script = [] - endif - let script += map(copy(deldir), 'printf(rmdir, shellescape(v:val, 1))') - let script = tlib#list#Uniq(script) - call writefile(script, scriptfile) - call inputsave() - if g:tlib#cache#run_script == 0 - if g:tlib#cache#verbosity >= 1 - echohl WarningMsg - if g:tlib#cache#verbosity >= 2 - echom "TLib: Purged cache. Need to run script to delete directories" - endif - echom "TLib: Please review and execute: ". scriptfile - echohl NONE + let deldir = filter(reverse(sort(deldir)), 's:Delete(msg, v:val, "d")') + if !empty(deldir) + if &shell =~ 'sh\(\.exe\)\?$' + let scriptfile = 'deldir.sh' + let rmdir = 'rm -rf %s' + else + let scriptfile = 'deldir.bat' + let rmdir = 'rmdir /S /Q %s' endif - else - try - let yn = g:tlib#cache#run_script == 2 ? 'y' : tlib#input#Dialog("TLib: About to delete directories by means of a shell script.\nDirectory removal script: ". scriptfile ."\nRun script to delete directories now?", ['yes', 'no', 'edit'], 'no') - if yn =~ '^y\%[es]$' - exec 'silent cd '. fnameescape(dir) - exec '! ' &shell shellescape(scriptfile, 1) - exec 'silent cd -' - call delete(scriptfile) - elseif yn =~ '^e\%[dit]$' - exec 'edit '. fnameescape(scriptfile) + let enc = g:tlib#cache#script_encoding + if has('multi_byte') && enc != &enc + call map(deldir, 'iconv(v:val, &enc, enc)') + endif + let scriptfile = tlib#file#Join([dir, scriptfile]) + if filereadable(scriptfile) + let script = readfile(scriptfile) + else + let script = [] + endif + let script += map(copy(deldir), 'printf(rmdir, shellescape(v:val, 1))') + let script = tlib#list#Uniq(script) + call writefile(script, scriptfile) + call inputsave() + if g:tlib#cache#run_script == 0 + if g:tlib#cache#verbosity >= 1 + echohl WarningMsg + if g:tlib#cache#verbosity >= 2 + echom "TLib: Purged cache. Need to run script to delete directories" + endif + echom "TLib: Please review and execute: ". scriptfile + echohl NONE endif - finally - call inputrestore() - endtry + else + try + let yn = g:tlib#cache#run_script == 2 ? 'y' : tlib#input#Dialog("TLib: About to delete directories by means of a shell script.\nDirectory removal script: ". scriptfile ."\nRun script to delete directories now?", ['yes', 'no', 'edit'], 'no') + if yn =~ '^y\%[es]$' + exec 'silent cd '. fnameescape(dir) + exec '! ' &shell shellescape(scriptfile, 1) + exec 'silent cd -' + call delete(scriptfile) + elseif yn =~ '^e\%[dit]$' + exec 'edit '. fnameescape(scriptfile) + endif + finally + call inputrestore() + endtry + endif endif endif call s:PurgeTimestamp(dir) endf +function! s:Delete(msg, file, flags) abort "{{{3 + let rv = delete(a:file, a:flags) + if !rv && g:tlib#cache#verbosity >= 2 + call add(a:msg, "TLib#cache: Delete ". file) + endif + return rv +endf + + function! s:PurgeTimestamp(dir) "{{{3 let last_purge = tlib#file#Join([a:dir, '.last_purge']) " TLogVAR last_purge diff -Nru vim-tlib-1.20/autoload/tlib/date.vim vim-tlib-1.23/autoload/tlib/date.vim --- vim-tlib-1.20/autoload/tlib/date.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/date.vim 2017-03-16 19:32:34.000000000 +0000 @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2010-03-25. -" @Last Change: 2016-01-21. -" @Revision: 25.0.34 +" @Last Change: 2016-06-06. +" @Revision: 41.0.34 if !exists('g:tlib#date#ShortDatePrefix') | let g:tlib#date#ShortDatePrefix = '20' | endif "{{{2 @@ -22,8 +22,9 @@ endf -function! tlib#date#Format(secs1970) abort "{{{3 - return strftime(g:tlib#date#date_format, a:secs1970) +function! tlib#date#Format(...) abort "{{{3 + let secs1970 = a:0 >= 1 ? a:1 : localtime() + return strftime(g:tlib#date#date_format, secs1970) endf @@ -141,12 +142,23 @@ let ml = matchlist(a:date, g:tlib#date#date_rx) " TLogVAR a:date, a:shift, n, ml if a:shift =~ 'd$' - let secs = tlib#date#SecondsSince1970(a:date) + g:tlib#date#dayshift * n - " TLogVAR secs + let date = tlib#date#AddDays(a:date, n) + elseif a:shift =~ 'b$' + let n1 = n + let secs = tlib#date#SecondsSince1970(a:date) + while n1 > 0 + let n1 -= 1 + let secs += g:tlib#date#dayshift + let uday = strftime('%u', secs) + if uday == 6 + let secs += g:tlib#date#dayshift * 2 + elseif uday == 7 + let secs += g:tlib#date#dayshift + endif + endwh let date = tlib#date#Format(secs) elseif a:shift =~ 'w$' - let secs = tlib#date#SecondsSince1970(a:date) + g:tlib#date#dayshift * n * 7 - let date = tlib#date#Format(secs) + let date = tlib#date#AddDays(a:date, n * 7) elseif a:shift =~ 'm$' let d = str2nr(ml[3]) let ms = str2nr(ml[2]) + n @@ -157,6 +169,8 @@ elseif a:shift =~ 'y$' let yr = str2nr(ml[1]) + n let date = substitute(a:date, '^\d\{4}', yr, '') + else + throw 'tlib#date#Shift: Unsupported arguments: '. string(a:shift) endif " if !empty(ml[4]) && date !~ '\s'. ml[4] .'$' " let date .= ' '. ml[4] @@ -165,3 +179,11 @@ return date endf + +function! tlib#date#AddDays(date, n) abort "{{{3 + let secs = tlib#date#SecondsSince1970(a:date) + g:tlib#date#dayshift * a:n + " TLogVAR secs + let date = tlib#date#Format(secs) + return date +endf + diff -Nru vim-tlib-1.20/autoload/tlib/dictionary.vim vim-tlib-1.23/autoload/tlib/dictionary.vim --- vim-tlib-1.20/autoload/tlib/dictionary.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/dictionary.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,14 +1,44 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: https://github.com/tomtom " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2015-10-14 -" @Revision: 2 +" @Last Change: 2016-04-06 +" @Revision: 22 -function! tlib#dictionary#Rev(dict) abort "{{{3 +" :display: tlib#dictionary#Rev(dict, ?opts = {}) abort "{{{3 +function! tlib#dictionary#Rev(dict, ...) abort "{{{3 + let opts = a:0 >= 1 ? a:1 : {} + Tlibtype a:dict, 'dict', opts, 'dict' let rev = {} + let use_string = get(opts, 'use_string', 0) + let use_eval = get(opts, 'use_eval', 0) + let values_as_list = get(opts, 'values_as_list', 0) for [m, f] in items(a:dict) - let rev[f] = m + if use_string + let k = string(f) + else + let k = type(f) == 1 ? f : string(f) + if k ==# '' + let k = get(opts, 'empty', '') + if empty(k) + continue + endif + endif + endif + if use_eval + let v = eval(m) + else + let v = m + endif + if values_as_list + if has_key(rev, k) + call add(rev[k], v) + else + let rev[k] = [v] + endif + else + let rev[k] = v + endif endfor return rev endf diff -Nru vim-tlib-1.20/autoload/tlib/file.vim vim-tlib-1.23/autoload/tlib/file.vim --- vim-tlib-1.20/autoload/tlib/file.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/file.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,7 +1,7 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 168 +" @Revision: 194 if !exists('g:tlib#file#drop') @@ -24,6 +24,12 @@ let g:tlib#file#absolute_filename_rx = '^\~\?[\/]' "{{{2 endif + +if !exists('g:tlib#file#reject_rx') + let g:tlib#file#reject_rx = '\%(^\|[\/]\)\%(\.\w\+\%($\|[\/]\)\|\%(tags\|Thumbs\.db\)$\)' "{{{2 +endif + + """ File related {{{1 " For the following functions please see ../../test/tlib.vim for examples. @@ -33,7 +39,7 @@ " => ['foo', 'bar', 'filename.txt'] function! tlib#file#Split(filename) "{{{3 let prefix = matchstr(a:filename, '^\(\w\+:\)\?/\+') - " TLogVAR prefix + Tlibtrace 'tlib', prefix if !empty(prefix) let filename = a:filename[len(prefix) : -1] else @@ -54,7 +60,7 @@ " => 'foo/bar/filename.txt' function! tlib#file#Join(filename_parts, ...) "{{{3 TVarArg ['strip_slashes', 1], 'maybe_absolute' - " TLogVAR a:filename_parts, strip_slashes + Tlibtrace 'tlib', a:filename_parts, strip_slashes if maybe_absolute let filename_parts = [] for part in a:filename_parts @@ -70,7 +76,7 @@ " let rx = tlib#rx#Escape(g:tlib#dir#sep) .'$' let rx = '[/\\]\+$' let parts = map(copy(filename_parts), 'substitute(v:val, rx, "", "")') - " TLogVAR parts + Tlibtrace 'tlib', parts return join(parts, g:tlib#dir#sep) else return join(filename_parts, g:tlib#dir#sep) @@ -82,17 +88,17 @@ " tlib#file#Relative('foo/bar/filename.txt', 'foo') " => 'bar/filename.txt' function! tlib#file#Relative(filename, basedir) "{{{3 - " TLogVAR a:filename, a:basedir + Tlibtrace 'tlib', a:filename, a:basedir " TLogDBG getcwd() " TLogDBG expand('%:p') let b0 = tlib#file#Absolute(a:basedir) let b = tlib#file#Split(b0) - " TLogVAR b + Tlibtrace 'tlib', b let f0 = tlib#file#Absolute(a:filename) let fn = fnamemodify(f0, ':t') let fd = fnamemodify(f0, ':h') let f = tlib#file#Split(fd) - " TLogVAR f0, fn, fd, f + Tlibtrace 'tlib', f0, fn, fd, f if f[0] != b[0] let rv = f0 else @@ -103,14 +109,19 @@ call remove(f, 0) call remove(b, 0) endwh - " TLogVAR f, b + Tlibtrace 'tlib', f, b let rv = tlib#file#Join(repeat(['..'], len(b)) + f + [fn]) endif - " TLogVAR rv + Tlibtrace 'tlib', rv return rv endf +function! tlib#file#IsAbsolute(filename) "{{{3 + return a:filename =~? '^\%(/\|\w\+:/\)' +endf + + function! tlib#file#Absolute(filename, ...) "{{{3 if filereadable(a:filename) let filename = fnamemodify(a:filename, ':p') @@ -155,7 +166,7 @@ " :def: function! tlib#file#With(fcmd, bcmd, files, ?world={}) function! tlib#file#With(fcmd, bcmd, files, ...) "{{{3 - " TLogVAR a:fcmd, a:bcmd, a:files + Tlibtrace 'tlib', a:fcmd, a:bcmd, a:files exec tlib#arg#Let([['world', {}]]) call tlib#autocmdgroup#Init() augroup TLibFileRead @@ -163,14 +174,15 @@ augroup END for f in a:files let bn = bufnr('^'.f.'$') - " TLogVAR f, bn + Tlibtrace 'tlib', f, bn let bufloaded = bufloaded(bn) let ok = 0 let s:bufread = "" if bn != -1 && buflisted(bn) if !empty(a:bcmd) - " TLogDBG a:bcmd .' '. bn - exec a:bcmd .' '. bn + let bcmd = a:bcmd .' '. bn + Tlibtrace 'tlib', bcmd + exec bcmd let ok = 1 call s:SetScrollBind(world) endif @@ -180,7 +192,9 @@ " TLogDBG a:fcmd .' '. tlib#arg#Ex(f) exec 'autocmd TLibFileRead BufRead' escape(f, '\ ') 'let s:bufread=expand(":p")' try - exec a:fcmd .' '. tlib#arg#Ex(f) + let fcmd = a:fcmd .' '. tlib#arg#Ex(f) + Tlibtrace 'tlib', fcmd + exec fcmd finally exec 'autocmd! TLibFileRead BufRead' endtry @@ -193,7 +207,7 @@ echohl NONE endif endif - " TLogVAR ok, bufloaded, &filetype + Tlibtrace 'tlib', ok, bufloaded, &filetype if empty(s:bufread) && ok && !bufloaded && empty(&filetype) doautocmd BufRead endif @@ -217,20 +231,22 @@ if filename == expand('%:p') return 1 else - " TLogVAR a:fileid, bn, filename, g:tlib#file#drop, filereadable(filename) + Tlibtrace 'tlib', a:fileid, bn, filename, g:tlib#file#drop, filereadable(filename), bufnr('%') if bn != -1 && buflisted(bn) if g:tlib#file#drop " echom "DBG" get(g:tlib#file#edit_cmds, 'drop', 'drop') fnameescape(filename) exec get(g:tlib#file#edit_cmds, 'drop', 'drop') fnameescape(filename) + " echom "DBG" bufnr('%') else " echom "DBG" get(g:tlib#file#edit_cmds, 'buffer', 'buffer') bn exec get(g:tlib#file#edit_cmds, 'buffer', 'buffer') bn + " echom "DBG" bufnr('%') endif return 1 elseif filereadable(filename) try " let file = tlib#arg#Ex(filename) - " " TLogVAR file + " Tlibtrace 'tlib', file " echom "DBG" get(g:tlib#file#edit_cmds, 'edit', 'edit') fnameescape(filename) exec get(g:tlib#file#edit_cmds, 'edit', 'edit') fnameescape(filename) catch /E325/ @@ -252,26 +268,46 @@ endf +function! tlib#file#FilterFiles(files, options) abort "{{{3 + if !get(a:options, 'all', 0) + call filter(a:files, 'v:val !~# g:tlib#file#reject_rx') + endif + let type = get(a:options, 'type', 'fd') + if type !~# 'd' || type !~# 'f' + call filter(a:files, 'isdirectory(v:val) ? type =~# "d" : type =~# "f"') + endif + return a:files +endf + + if v:version > 704 || (v:version == 704 && has('patch279')) - function! tlib#file#Glob(pattern) abort "{{{3 - return glob(a:pattern, 0, 1) + function! tlib#file#Glob(pattern, ...) abort "{{{3 + let all = a:0 >= 1 ? a:1 : 0 + let nosuf = a:0 >= 2 ? a:2 : 0 + return tlib#file#FilterFiles(glob(a:pattern, nosuf, 1), {'all': all}) endf - function! tlib#file#Globpath(path, pattern) abort "{{{3 - return globpath(a:path, a:pattern, 0, 1) + function! tlib#file#Globpath(path, pattern, ...) abort "{{{3 + let all = a:0 >= 1 ? a:1 : 0 + let nosuf = a:0 >= 2 ? a:2 : 0 + return tlib#file#FilterFiles(globpath(a:path, a:pattern, nosuf, 1), {'all': all}) endf else " :nodoc: - function! tlib#file#Glob(pattern) abort "{{{3 - return split(glob(a:pattern), '\n') + function! tlib#file#Glob(pattern, ...) abort "{{{3 + let all = a:0 >= 1 ? a:1 : 0 + let nosuf = a:0 >= 2 ? a:2 : 0 + return tlib#file#FilterFiles(split(glob(a:pattern, nosuf), '\n'), {'all': all}) endf " :nodoc: - function! tlib#file#Globpath(path, pattern) abort "{{{3 - return split(globpath(a:path, a:pattern), '\n') + function! tlib#file#Globpath(path, pattern, ...) abort "{{{3 + let all = a:0 >= 1 ? a:1 : 0 + let nosuf = a:0 >= 2 ? a:2 : 0 + return tlib#file#FilterFiles(split(globpath(a:path, a:pattern), '\n'), {'all': all}) endf endif diff -Nru vim-tlib-1.20/autoload/tlib/input.vim vim-tlib-1.23/autoload/tlib/input.vim --- vim-tlib-1.20/autoload/tlib/input.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/input.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,7 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 1366 - +" @Revision: 1392 " :filedoc: " Input-related, select from a list etc. @@ -312,7 +311,7 @@ if !empty(filter) " let world.initial_filter = [[''], [filter]] " let world.initial_filter = [[filter]] - " TLogVAR world.initial_filter + Tlibtrace 'tlib', world.initial_filter, filter call world.SetInitialFilter(filter) endif endif @@ -333,10 +332,11 @@ " (an instance of tlib#World as returned by |tlib#World#New|). function! tlib#input#ListW(world, ...) "{{{3 TVarArg 'cmd' - " let time0 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time0 + let time0 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time0 let world = a:world if world.pick_last_item >= 1 && stridx(world.type, 'e') == -1 && len(world.base) <= 1 + call world.CloseScratch(1) let rv = get(world.base, 0, world.rv) if stridx(world.type, 'm') != -1 return [rv] @@ -345,7 +345,7 @@ endif endif call s:Init(world, cmd) - " TLogVAR world.state, world.sticky, world.initial_index + Tlibtrace 'tlib', world.state, world.sticky, world.initial_index " let statusline = &l:statusline " let laststatus = &laststatus let showmode = &showmode @@ -361,38 +361,24 @@ try while !empty(world.state) && world.state !~ '^exit' && (world.show_empty || !empty(world.base)) let post_keys = '' - " TLogDBG 'while' - " TLogVAR world.state - " let time01 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time01, time01 - time0 + Tlibtrace 'tlib', 'while', world.state + let time01 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time01, time01 - time0 try let world = s:RunStateHandlers(world) - " if exists('b:tlib_world_event') - " let event = b:tlib_world_event - " unlet! b:tlib_world_event - " if event == 'WinLeave' - " " let world.resume_state = world.state - " let world = tlib#agent#Suspend(world, world.rv) - " break - " endif - " endif - - " let time02 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time02, time02 - time0 + let time02 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time02, time02 - time0 if world.state =~ '\' - " TLogDBG 'reset' - " call world.Reset(world.state =~ '\') call world.Reset() continue endif call s:SetOffset(world) - " let time02 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time02, time02 - time0 - " TLogDBG 1 - " TLogVAR world.state + let time02 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time02, time02 - time0 + Tlibtrace 'tlib', world.state if world.state == 'scroll' let world.prefidx = world.offset let world.state = 'redisplay' @@ -402,33 +388,26 @@ let world.sticky = 1 endif - " TLogVAR world.filter - " TLogVAR world.sticky + Tlibtrace 'tlib', world.filter + Tlibtrace 'tlib', world.sticky if world.state =~ '\' - " TLogVAR world.rv + Tlibtrace 'tlib', world.rv throw 'picked' elseif world.state =~ '\' let world.rv = world.CurrentItem() - " TLogVAR world.rv + Tlibtrace 'tlib', world.rv throw 'picked' elseif world.state =~ 'display' if world.state =~ '^display' - " let time03 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time03, time03 - time0 + let time03 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time03, time03 - time0 if world.IsValidFilter() - - " let time1 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time1, time1 - time0 + let time1 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time1, time1 - time0 call world.BuildTableList() - " let time2 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time2, time2 - time0 - " TLogDBG 2 - " TLogDBG len(world.table) - " TLogVAR world.table - " let world.list = map(copy(world.table), 'world.GetBaseItem(v:val)') - " TLogDBG 3 + let time2 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time2, time2 - time0 let world.llen = len(world.list) - " TLogVAR world.index_table if empty(world.index_table) let dindex = range(1, world.llen) let world.index_width = len(world.llen) @@ -436,12 +415,11 @@ let dindex = world.index_table let world.index_width = len(max(dindex)) endif - " let time3 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time3, time3 - time0 + let time3 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time3, time3 - time0 if world.llen == 0 && !world.show_empty call world.ReduceFilter() let world.offset = 1 - " TLogDBG 'ReduceFilter' continue else if world.llen == 1 @@ -449,18 +427,15 @@ if world.pick_last_item >= 2 " echom 'Pick last item: '. world.list[0] let world.prefidx = '1' - " TLogDBG 'pick last item' throw 'pick' endif else let world.last_item = '' endif endif - " let time4 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time4, time4 - time0 - " TLogDBG 4 - " TLogVAR world.idx, world.llen, world.state - " TLogDBG world.FilterIsEmpty() + let time4 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time4, time4 - time0 + Tlibtrace 'tlib', world.idx, world.llen, world.state if world.state == 'display' if world.idx == '' && world.llen < g:tlib#input#sortprefs_threshold && !world.FilterIsEmpty() call world.SetPrefIdx() @@ -473,27 +448,22 @@ let world.prefidx = 1 endif endif - " let time5 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time5, time5 - time0 - " TLogVAR world.initial_index, world.prefidx - " TLogDBG 5 - " TLogDBG len(world.list) - " TLogVAR world.list + let time5 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time5, time5 - time0 + Tlibtrace 'tlib', world.initial_index, world.prefidx + Tlibtrace 'tlib', len(world.list) let dlist = world.DisplayFormat(world.list) - " TLogVAR world.prefidx - " TLogDBG 6 - " let time6 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time6, time6 - time0 + Tlibtrace 'tlib', world.prefidx + let time6 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time6, time6 - time0 if world.offset_horizontal > 0 call map(dlist, 'v:val[world.offset_horizontal:-1]') endif - " let time7 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time7, time7 - time0 - " TLogVAR dindex + let time7 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time7, time7 - time0 let dlist = map(range(0, world.llen - 1), 'printf("%0'. world.index_width .'d", dindex[v:val]) .": ". dlist[v:val]') - " TLogVAR dlist - " let time8 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time8, time8 - time0 + let time8 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time8, time8 - time0 else @@ -505,30 +475,14 @@ let world.prefidx = 1 endif endif - " TLogVAR world.idx, world.prefidx + Tlibtrace 'tlib', world.idx, world.prefidx - " TLogDBG 7 - " TLogVAR world.prefidx, world.offset - " TLogDBG (world.prefidx > world.offset + winheight(0) - 1) - " if world.prefidx > world.offset + winheight(0) - 1 - " let listtop = world.llen - winheight(0) + 1 - " let listoff = world.prefidx - winheight(0) + 1 - " let world.offset = min([listtop, listoff]) - " TLogVAR world.prefidx - " TLogDBG len(list) - " TLogDBG winheight(0) - " TLogVAR listtop, listoff, world.offset - " elseif world.prefidx < world.offset - " let world.offset = world.prefidx - " endif - " TLogDBG 8 - " TLogVAR world.initial_display, !tlib#char#IsAvailable() + Tlibtrace 'tlib', world.prefidx, world.offset + Tlibtrace 'tlib', world.initial_display, !tlib#char#IsAvailable() if world.state =~ '\' || world.initial_display || !tlib#char#IsAvailable() - " TLogDBG len(dlist) call world.DisplayList(world.Query(), dlist) call world.FollowCursor() let world.initial_display = 0 - " TLogDBG 9 endif if world.state =~ '\' let world.state = 'suspend' @@ -548,9 +502,10 @@ endif endif " TAssert IsNotEmpty(world.scratch) + let world.list_wid = tlib#win#GetID() let world.list_wnr = winnr() - " TLogVAR world.state, world.next_state + Tlibtrace 'tlib', world.state, world.next_state if !empty(world.next_state) let world.state = world.next_state let world.next_state = '' @@ -568,7 +523,7 @@ endif if has('gui_win32') let exec_cmd = input(query, '') - " TLogVAR exec_cmd + Tlibtrace 'tlib', exec_cmd if exec_cmd == '' let world.state = 'redisplay' else @@ -576,17 +531,15 @@ endif elseif has('gui_gtk') || has('gui_gtk2') let c = s:GetModdedChar(world) - " TLogVAR c + Tlibtrace 'tlib', c endif else - " TLogVAR world.timeout + Tlibtrace 'tlib', world.timeout let c = s:GetModdedChar(world) - " TLogVAR c, has_key(world.key_map[world.key_mode],c) + Tlibtrace 'tlib', c, has_key(world.key_map[world.key_mode],c) endif - " TLogVAR c - " TLogDBG string(sort(keys(world.key_map[world.key_mode]))) - - " TLogVAR world.next_agent, world.next_eval + Tlibtrace 'tlib', c + Tlibtrace 'tlib', world.next_agent, world.next_eval if !empty(world.next_agent) let nagent = world.next_agent let world.next_agent = '' @@ -604,19 +557,17 @@ elseif has_key(world.key_map[world.key_mode], c) let sr = @/ silent! let @/ = lastsearch - " TLogVAR c, world.key_map[world.key_mode][c] + Tlibtrace 'tlib', c, world.key_map[world.key_mode][c] " TLog "Agent: ". string(world.key_map[world.key_mode][c]) let handler = world.key_map[world.key_mode][c] - " " TLogVAR handler - " let world = call(handler.agent, [world, world.GetSelectedItems(world.CurrentItem())]) - " call s:CheckAgentReturnValue(c, world) + Tlibtrace 'tlib', handler let world = s:CallAgent(handler, world, world.GetSelectedItems(world.CurrentItem())) silent! let @/ = sr " continue elseif c == 13 throw 'pick' elseif c == 27 - " TLogVAR c, world.key_mode + Tlibtrace 'tlib', c, world.key_mode if world.key_mode != 'default' let world.key_mode = 'default' let world.state = 'redisplay' @@ -666,7 +617,7 @@ let world.state = 'exit empty' endif endif - " TLogVAR world.prefidx, world.state + Tlibtrace 'tlib', world.prefidx, world.state elseif has_key(world.key_map[world.key_mode], 'unknown_key') let agent = world.key_map[world.key_mode].unknown_key.agent " let world = call(agent, [world, c]) @@ -675,17 +626,17 @@ elseif c >= 32 let world.state = 'display' let numbase = get(world.numeric_chars, c, -99999) - " TLogVAR numbase, world.numeric_chars, c + Tlibtrace 'tlib', numbase, world.numeric_chars, c if numbase != -99999 let world.idx .= (c - numbase) if len(world.idx) == world.index_width let world.prefidx = world.idx - " TLogVAR world.prefidx + Tlibtrace 'tlib', world.prefidx throw 'pick' endif else let world.idx = '' - " TLogVAR world.filter + Tlibtrace 'tlib', world.filter if world.llen > g:tlib#input#livesearch_threshold let pattern = input('Filter: ', world.CleanFilter(world.filter[0][0]) . nr2char(c)) if empty(pattern) @@ -718,61 +669,50 @@ call world.ClearAllMarks() call world.MarkCurrent(world.prefidx) let world.state = '' - " TLogDBG 'Pick item #'. world.prefidx finally - " TLogDBG 'finally 1', world.state if world.state =~ '\' " if !world.allow_suspend " echom "Cannot be suspended" " let world.state = 'redisplay' " endif elseif !empty(world.list) && !empty(world.base) - " TLogVAR world.list if empty(world.state) let world.rv = world.CurrentItem() - " TLogVAR world.state, world.rv + Tlibtrace 'tlib', world.state, world.rv endif - " TLogVAR "postprocess" for handler in world.post_handlers let state = get(handler, 'postprocess', '') - " TLogVAR handler - " TLogVAR state - " TLogVAR world.state + Tlibtrace 'tlib', handler + Tlibtrace 'tlib', state + Tlibtrace 'tlib', world.state if state == world.state let agent = handler.agent let [world, world.rv] = call(agent, [world, world.rv]) - " TLogVAR world.state, world.rv + Tlibtrace 'tlib', world.state, world.rv call s:CheckAgentReturnValue(agent, world) endif endfor endif - " TLogDBG 'state0='. world.state endtry - " TLogDBG 'state1='. world.state endwh - " TLogVAR world.state - " TLogDBG string(tlib#win#List()) - " TLogDBG 'exit while loop' - " TLogVAR world.list - " TLogVAR world.sel_idx - " TLogVAR world.idx - " TLogVAR world.prefidx - " TLogVAR world.rv - " TLogVAR world.type, world.state, world.return_agent, world.index_table, world.rv + Tlibtrace 'tlib', world.state + Tlibtrace 'tlib', len(world.list) + Tlibtrace 'tlib', world.sel_idx + Tlibtrace 'tlib', world.idx + Tlibtrace 'tlib', world.prefidx + Tlibtrace 'tlib', world.rv if world.state =~ '\<\(empty\|escape\)\>' let world.sticky = 0 endif if world.state =~ '\' - " TLogDBG 'return suspended' - " TLogVAR world.prefidx + Tlibtrace 'tlib', world.prefidx " exec world.prefidx return elseif world.state =~ '\' " TLog "empty" - " TLogDBG 'return empty' - " TLogVAR world.type + Tlibtrace 'tlib', world.type if stridx(world.type, 'm') != -1 return [] elseif stridx(world.type, 'i') != -1 @@ -781,23 +721,18 @@ return '' endif elseif !empty(world.return_agent) - " TLogDBG 'return agent' - " TLogVAR world.return_agent - call world.CloseScratch() - " TLogDBG "return_agent ". string(tlib#win#List()) + Tlibtrace 'tlib', world.return_agent + call world.CloseScratch(1) " TAssert IsNotEmpty(world.scratch) return call(world.return_agent, [world, world.GetSelectedItems(world.rv)]) elseif stridx(world.type, 'w') != -1 " TLog "return_world" - " TLogDBG 'return world' return world elseif stridx(world.type, 'm') != -1 " TLog "return_multi" - " TLogDBG 'return multi' return world.GetSelectedItems(world.rv) elseif stridx(world.type, 'i') != -1 " TLog "return_index" - " TLogDBG 'return index' if empty(world.index_table) return world.rv else @@ -805,14 +740,13 @@ endif else " TLog "return_else" - " TLogDBG 'return normal' return world.rv endif finally call world.Leave() - " TLogVAR statusline + " Tlibtrace 'tlib', statusline " let &l:statusline = statusline " let &laststatus = laststatus if &showmode != showmode @@ -824,40 +758,34 @@ silent! aunmenu ]TLibInputListPopupMenu endif - " TLogDBG 'finally 2' - " TLogDBG string(world.Methods()) - " TLogVAR world.state - " TLogDBG string(tlib#win#List()) + Tlibtrace 'tlib', world.state if world.state !~ '\' " redraw - " TLogVAR world.sticky, bufnr("%") + Tlibtrace 'tlib', world.sticky, bufnr("%") if world.sticky - " TLogDBG "sticky" - " TLogVAR world.bufnr - " TLogDBG bufwinnr(world.bufnr) + Tlibtrace 'tlib', world.bufnr if world.scratch_split > 0 if bufwinnr(world.bufnr) == -1 - " TLogDBG "UseScratch" call world.UseScratch() endif let world = tlib#agent#SuspendToParentWindow(world, world.GetSelectedItems(world.rv)) endif else - " TLogDBG "non sticky" - " TLogVAR world.state, world.win_wnr, world.bufnr - if world.CloseScratch() - " TLogVAR world.winview + Tlibtrace 'tlib', world.state, world.win_id, world.bufnr + if world.CloseScratch(1) + Tlibtrace 'tlib', world.winview call tlib#win#SetLayout(world.winview) endif endif endif + call world.RestoreWindow() " for i in range(0,5) " call getchar(0) " endfor echo redraw! if !empty(post_keys) - " TLogVAR post_keys + Tlibtrace 'tlib', post_keys call feedkeys(post_keys) endif endtry @@ -871,7 +799,7 @@ let args += a:handler.args endif let world = call(agent, args) - " TLogVAR world.state, world.rv + Tlibtrace 'tlib', world.state, world.rv call s:CheckAgentReturnValue(agent, world) return world endf @@ -887,7 +815,7 @@ function! s:Init(world, cmd) "{{{3 - " TLogVAR a:cmd + Tlibtrace 'tlib', a:cmd let a:world.initial_display = 1 if a:cmd =~ '\' let a:world.sticky = 1 @@ -905,7 +833,7 @@ " let a:world.state = a:world.resume_state " endif elseif !a:world.initialized - " TLogVAR a:world.initialized, a:world.win_wnr, a:world.bufnr + Tlibtrace 'tlib', a:world.initialized, a:world.win_id, a:world.bufnr let a:world.filetype = &filetype let a:world.fileencoding = &fileencoding call a:world.SetMatchMode(tlib#var#Get('tlib#input#filter_mode', 'wb')) @@ -913,9 +841,9 @@ if !has_key(a:world, 'key_mode') let a:world.key_mode = 'default' endif - " TLogVAR has_key(a:world,'key_map') + Tlibtrace 'tlib', has_key(a:world,'key_map') if has_key(a:world, 'key_map') - " TLogVAR has_key(a:world.key_map,a:world.key_mode) + Tlibtrace 'tlib', has_key(a:world.key_map,a:world.key_mode) if has_key(a:world.key_map, a:world.key_mode) let a:world.key_map[a:world.key_mode] = extend( \ a:world.key_map[a:world.key_mode], @@ -929,14 +857,14 @@ \ a:world.key_mode : copy(g:tlib#input#keyagents_InputList_s) \ } endif - " TLogVAR a:world.type + Tlibtrace 'tlib', a:world.type if stridx(a:world.type, 'm') != -1 call extend(a:world.key_map[a:world.key_mode], g:tlib#input#keyagents_InputList_m, 'force') endif for key_mode in keys(a:world.key_map) let a:world.key_map[key_mode] = map(a:world.key_map[key_mode], 'type(v:val) == 4 ? v:val : {"agent": v:val}') endfor - " TLogVAR a:world.key_mode + Tlibtrace 'tlib', a:world.key_mode if type(a:world.key_handlers) == 3 call s:ExtendKeyMap(a:world, a:world.key_mode, a:world.key_handlers) elseif type(a:world.key_handlers) == 4 @@ -946,12 +874,12 @@ else throw "tlib#input#ListW: key_handlers must be either a list or a dictionary" endif - " TLogVAR a:world.type, a:world.key_map + Tlibtrace 'tlib', a:world.type, a:world.key_map if !empty(a:cmd) let a:world.state .= ' '. a:cmd endif endif - " TLogVAR a:world.state, a:world.sticky + Tlibtrace 'tlib', a:world.state, a:world.sticky endf @@ -979,7 +907,7 @@ let rv = 0 endtry endif - " TLogVAR rv + Tlibtrace 'tlib', rv return rv endf @@ -1144,9 +1072,9 @@ let handlers = a:0 >= 1 && !empty(a:1) ? a:1 : g:tlib#input#handlers_EditList let default = a:0 >= 2 ? a:2 : [] let timeout = a:0 >= 3 ? a:3 : 0 - " TLogVAR handlers + Tlibtrace 'tlib', handlers let rv = tlib#input#List('me', a:query, copy(a:list), handlers, default, timeout) - " TLogVAR rv + Tlibtrace 'tlib', rv if empty(rv) return a:list else @@ -1157,7 +1085,7 @@ function! tlib#input#Resume(name, pick, bufnr) "{{{3 - " TLogVAR a:name, a:pick + Tlibtrace 'tlib', a:name, a:pick echo if bufnr('%') != a:bufnr if g:tlib#debug @@ -1246,9 +1174,9 @@ " endf " call tlib#input#Edit('foo', b:var, 'FooContinue') function! tlib#input#Edit(name, value, callback, ...) "{{{3 - " TLogVAR a:value + Tlibtrace 'tlib', a:value TVarArg ['args', []] - let sargs = {'scratch': '__EDIT__'. a:name .'__', 'win_wnr': winnr()} + let sargs = {'scratch': '__EDIT__'. a:name .'__', 'winid': tlib#win#GetID()} let scr = tlib#scratch#UseScratch(sargs) " :nodoc: @@ -1304,9 +1232,9 @@ let cb = b:tlib_scratch_edit_callback let args = b:tlib_scratch_edit_args let sargs = b:tlib_scratch_edit_scratch - " TLogVAR cb, args, sargs + Tlibtrace 'tlib', cb, args, sargs call tlib#scratch#CloseScratch(b:tlib_scratch_edit_scratch) - call tlib#win#Set(sargs.win_wnr) + call tlib#win#SetById(sargs.win_id) call call(cb, args + [ok, text]) endf diff -Nru vim-tlib-1.20/autoload/tlib/list.vim vim-tlib-1.23/autoload/tlib/list.vim --- vim-tlib-1.20/autoload/tlib/list.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/list.vim 2017-03-16 19:32:34.000000000 +0000 @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-30. -" @Last Change: 2015-10-21. -" @Revision: 61 +" @Last Change: 2016-03-22. +" @Revision: 68 """ List related functions {{{1 @@ -146,11 +146,17 @@ call filter(a:list, 'type(v:val) == 0 || !empty(v:val)') endif " CREDITS: Based on syntastic#util#unique(list) by scrooloose + let emptystring = 0 let seen = {} let uniques = [] if empty(get_value) for e in a:list - if !has_key(seen, e) + if e == '' + if !emptystring + let emptystring = 1 + call add(uniques, e) + endif + elseif !has_key(seen, e) let seen[e] = 1 call add(uniques, e) endif @@ -159,11 +165,16 @@ else for e in a:list let v = eval(printf(get_value, string(e))) - if !has_key(seen, v) + if v == '' + if !emptystring + let emptystring = 1 + call add(uniques, v) + endif + elseif !has_key(seen, v) let seen[v] = 1 - call add(uniques, e) + call add(uniques, v) endif - unlet e + unlet e v endfor endif return uniques diff -Nru vim-tlib-1.20/autoload/tlib/notify.vim vim-tlib-1.23/autoload/tlib/notify.vim --- vim-tlib-1.20/autoload/tlib/notify.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/notify.vim 2017-03-16 19:32:34.000000000 +0000 @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2008-09-19. -" @Last Change: 2015-04-07. -" @Revision: 0.3.19 +" @Last Change: 2016-06-28. +" @Revision: 2.3.19 let s:save_cpo = &cpo set cpo&vim @@ -101,5 +101,13 @@ endfunction +function! tlib#notify#PrintError() abort "{{{3 + echohl ErrorMsg + echom v:exception + echom v:throwpoint + echohl NONE +endf + + let &cpo = s:save_cpo unlet s:save_cpo diff -Nru vim-tlib-1.20/autoload/tlib/progressbar.vim vim-tlib-1.23/autoload/tlib/progressbar.vim --- vim-tlib-1.20/autoload/tlib/progressbar.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/progressbar.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,10 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 72 +" @Revision: 85 +let s:id = 0 +let s:ids = [] let s:statusline = [] let s:laststatus = [] let s:max = [] @@ -23,14 +25,48 @@ " endtry function! tlib#progressbar#Init(max, ...) "{{{3 TVarArg ['format', '%s'], ['width', 10] + let s:id += 1 + call insert(s:ids, s:id) call insert(s:statusline, &statusline) call insert(s:laststatus, &laststatus) call insert(s:max, a:max) call insert(s:format, format) call insert(s:width, width) call insert(s:value, -1) + let sl = { + \ 'id': s:id, + \ 'statusline': &statusline, + \ 'laststatus': &laststatus, + \ 'max': a:max, + \ 'format': format, + \ 'width': width, + \ 'value': -1 + \ } let &laststatus = 2 let s:timestamp = localtime() + return sl +endf + + +function! tlib#progressbar#Restore(...) "{{{3 + if a:0 >= 1 + let sl = a:1 + let idx = index(s:ids, sl.id) + let &l:statusline = sl.statusline + let &laststatus = sl.laststatus + else + let idx = 0 + let &l:statusline = remove(s:statusline, idx) + let &laststatus = remove(s:laststatus, idx) + endif + call remove(s:ids, idx) + call remove(s:max, idx) + call remove(s:format, idx) + call remove(s:width, idx) + call remove(s:value, idx) + redrawstatus + " redraw + " echo endf @@ -57,16 +93,3 @@ endf -function! tlib#progressbar#Restore() "{{{3 - let &l:statusline = remove(s:statusline, 0) - let &laststatus = remove(s:laststatus, 0) - redrawstatus - " redraw - " echo - call remove(s:max, 0) - call remove(s:format, 0) - call remove(s:width, 0) - call remove(s:value, 0) -endf - - diff -Nru vim-tlib-1.20/autoload/tlib/qfl.vim vim-tlib-1.23/autoload/tlib/qfl.vim --- vim-tlib-1.20/autoload/tlib/qfl.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/qfl.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,8 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: https://github.com/tomtom " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2015-12-06 -" @Revision: 60 +" @Last Change: 2017-02-23 +" @Revision: 66 " :nodoc: TLet g:tlib#qfl#world = { @@ -119,11 +119,11 @@ function! tlib#qfl#AgentEditQFE(world, selected, ...) "{{{3 - TVarArg ['cmd_edit', ''], ['cmd_buffer', ''] + TVarArg ['cmd_edit', ''], ['cmd_buffer', ''], ['set_origin', 1] " TVarArg ['cmd_edit', 'edit'], ['cmd_buffer', 'buffer'] " TLogVAR a:selected if empty(a:selected) - call a:world.RestoreOrigin() + " call a:world.RestoreOrigin() " call a:world.ResetSelected() else call a:world.RestoreOrigin() @@ -148,11 +148,13 @@ " TLogDBG bufname('%') " TLogVAR &filetype call tlib#buffer#ViewLine(qfe.lnum) - " call a:world.SetOrigin() " exec back endif endif endfor + if set_origin + call a:world.SetOrigin() + endif endif return a:world endf @@ -161,7 +163,7 @@ function! tlib#qfl#AgentPreviewQFE(world, selected) "{{{3 " TLogVAR a:selected let back = a:world.SwitchWindow('win') - call tlib#qfl#AgentEditQFE(a:world, a:selected[0:0]) + call tlib#qfl#AgentEditQFE(a:world, a:selected[0:0], '', '', 0) exec back redraw let a:world.state = 'redisplay' @@ -199,7 +201,7 @@ " TLogVAR a:cmd for entry in a:selected " TLogVAR entry, a:world.GetBaseItem(entry) - call tlib#qfl#AgentEditQFE(a:world, [entry]) + call tlib#qfl#AgentEditQFE(a:world, [entry], '', '', 0) " TLogDBG bufname('%') exec a:cmd " let item = a:world.data[a:world.GetBaseIdx(entry - 1)] diff -Nru vim-tlib-1.20/autoload/tlib/string.vim vim-tlib-1.23/autoload/tlib/string.vim --- vim-tlib-1.20/autoload/tlib/string.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/string.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,7 +1,7 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 122 +" @Revision: 142 " :def: function! tlib#string#RemoveBackslashes(text, ?chars=' ') @@ -22,6 +22,12 @@ endf +" Format a template string. Placeholders have the format "%{NAME}". A +" "%" can be inserted as "%%". +" +" Examples: +" echo tlib#string#Format("foo %{bar} foo", {'bar': 123}) +" => foo 123 foo function! tlib#string#Format(template, dict) "{{{3 let parts = split(a:template, '\ze%\({.\{-}}\|.\)') let out = [] @@ -164,3 +170,25 @@ call inputrestore() return rv endf + + +" :display: tlib#string#MatchAll(string, sep_regexp, ?item_regexp='') abort +function! tlib#string#MatchAll(string, regexp, ...) abort "{{{3 + let eregexp = a:0 >= 1 ? a:1 : '' + Tlibtrace 'tlib', a:string, a:regexp, eregexp + let ms = [] + if a:regexp =~ '\\ze' + let regexp1 = substitute(a:regexp, '\\ze.*$', '', '') + else + let regexp1 = a:regexp + endif + for m in split(a:string, '\ze'. regexp1) + let m1 = matchstr(m, !empty(eregexp) ? eregexp : a:regexp) + Tlibtrace 'tlib', m, m1 + if !empty(m1) + call add(ms, m1) + endif + endfor + return ms +endf + diff -Nru vim-tlib-1.20/autoload/tlib/sys.vim vim-tlib-1.23/autoload/tlib/sys.vim --- vim-tlib-1.20/autoload/tlib/sys.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/sys.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,7 +1,7 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2015-12-12. -" @Revision: 59 +" @Last Change: 2017-02-22. +" @Revision: 61 if !exists('g:tlib#sys#special_protocols') @@ -185,10 +185,7 @@ Tlibtrace 'tlib', a:filename if !empty(g:tlib#sys#system_browser) && tlib#sys#IsSpecial(a:filename) try - let cmd = printf(g:tlib#sys#system_browser, a:filename) - " let cmd = printf(g:tlib#sys#system_browser, escape(a:filename, ' %#!')) - Tlibtrace 'tlib', cmd - exec cmd + call tlib#sys#OpenWithSystemViewer(a:filename) return 1 catch echohl ErrorMsg @@ -200,6 +197,15 @@ endf +" Open filename with the default system viewer. +function! tlib#sys#OpenWithSystemViewer(filename) abort "{{{3 + let cmd = printf(g:tlib#sys#system_browser, a:filename) + " let cmd = printf(g:tlib#sys#system_browser, escape(a:filename, ' %#!')) + Tlibtrace 'tlib', cmd + exec cmd +endf + + " :def: function! tlib#sys#SystemInDir(dir, expr, ?input='') function! tlib#sys#SystemInDir(dir, ...) abort "{{{3 call tlib#dir#CD(a:dir) diff -Nru vim-tlib-1.20/autoload/tlib/trace.vim vim-tlib-1.23/autoload/tlib/trace.vim --- vim-tlib-1.20/autoload/tlib/trace.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/trace.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,8 @@ " @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: https://github.com/tomtom " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Last Change: 2016-01-25 -" @Revision: 146 +" @Last Change: 2017-03-09 +" @Revision: 205 if !exists('g:tlib#trace#backtrace') @@ -12,19 +12,42 @@ endif -if !exists('g:tlib#trace#printf') - " The command used for printing traces from |tlib#trace#Print()|. - let g:tlib#trace#printf = 'echom %s' "{{{2 +if !exists('g:tlib#trace#printer') + " Possible values: + " - 'echom' + " - ['file', FILENAME] + let g:tlib#trace#printer = 'echom' "{{{2 endif -let s:trace_hl = {'error': 'ErrorMsg', 'fatal': 'ErrorMsg', 'warning': 'WarningMsg'} +if !exists('g:tlib#trace#hl') + let g:tlib#trace#hl = {'error': 'ErrorMsg', 'fatal': 'ErrorMsg', 'warn': 'WarningMsg'} "{{{2 +endif -" Set |g:tlib#trace#printf| to make |tlib#trace#Print()| print to -" `filename`. -function! tlib#trace#PrintToFile(filename) abort "{{{3 - let g:tlib#trace#printf = 'call writefile([%s], '. string(a:filename) .', "a")' +" Print traces from |tlib#trace#Print()|. +function! tlib#trace#Printer_echom(type, text, args) abort "{{{3 + let hl = get(g:tlib#trace#hl, a:type, '') + try + if !empty(hl) + exec 'echohl' hl + endif + echom a:text + finally + if !empty(hl) + echohl NONE + endif + endtry +endf + + +function! tlib#trace#Printer_file(type, text, args) abort "{{{3 + let filename = get(a:args, 0, '') + if exists(filename) && !filewritable(filename) + throw 'tlib#trace#Printer_file: Cannot write to file: '. filename + else + call writefile([a:text], filename, 'a') + endif endf @@ -34,32 +57,56 @@ " Examples: " call tlib#trace#Set(["+foo", "-bar"]) " call tlib#trace#Set("+foo,-bar") -function! tlib#trace#Set(vars) abort "{{{3 +function! tlib#trace#Set(vars, ...) abort "{{{3 + let reset = a:0 >= 1 ? a:1 : 0 + if reset + call tlib#trace#Reset() + endif + if empty(a:vars) + return + endif call tlib#trace#Enable() - if type(a:vars) == 1 + if type(a:vars) == v:t_string let vars = tlib#string#SplitCommaList(a:vars, '[,[:space:]]\+') + let opts = {} + elseif type(a:vars) == v:t_dict + let vars = a:vars.__rest__ + if has_key(a:vars, 'file') + let g:tlib#trace#printer = ['file', a:vars.file] + endif + if has_key(a:vars, 'echo') + let g:tlib#trace#printer = 'echom' + endif else let vars = a:vars + let opts = {} endif " TLogVAR vars for rx in vars let rx1 = substitute(rx, '^[+-]', '', 'g') - if rx1 !~# '^\%(error\|fatal\)$' + if rx1 !~# '^\%(error\|warn\|fatal\)$' let erx1 = tlib#rx#Escape(rx1) " TLogVAR rx, rx1 " echom "DBG" s:trace_rx - if rx =~ '^+' - if s:trace_rx !~# '[(|]'. erx1 .'\\' - let s:trace_rx = substitute(s:trace_rx, '\ze\\)\$', '\\|'. erx1, '') - endif - elseif rx =~ '^-' + if rx =~ '^-' + let erx1 .= '\[0-\d\]\\?' if s:trace_rx =~# '[(|]'. erx1 .'\\' let s:trace_rx = substitute(s:trace_rx, '\\|'. erx1, '', '') endif + " elseif rx =~ '^+' else - echohl WarningMsg - echom 'tlib#trace#Print: Unsupported syntax:' rx - echohl NONE + if erx1 =~ '\d$' + let erx1 = substitute(erx1, '\d$', '[0-\0]\\?', '') + else + let erx1 .= '[0-9]\?' + endif + if s:trace_rx !~# '[(|]'. erx1 .'\\' + let s:trace_rx = substitute(s:trace_rx, '\ze\\)\$', '\\|'. escape(erx1, '\'), '') + endif + " else + " echohl WarningMsg + " echom 'tlib#trace#Print: Unsupported syntax:' rx + " echohl NONE endif " echom "DBG" s:trace_rx endif @@ -79,6 +126,7 @@ " Print the values of vars. The first value is a "guard" (see " |:Tlibtrace|). function! tlib#trace#Print(caller, vars, values) abort "{{{3 + " echom "DBG tlib#trace#Print" string(a:vars) string(a:values) let msg = ['TRACE'] let guard = a:values[0] if type(guard) == 0 @@ -96,25 +144,45 @@ call add(msg, bt .':') endif endif - for i in range(1, len(a:vars) - 1) - let v = substitute(a:vars[i], ',$', '', '') - let r = a:values[i] - if v =~# '^\([''"]\).\{-}\1$' - call add(msg, r .';') - else - call add(msg, v .'='. string(r) .';') - endif - unlet r - endfor - exec printf(g:tlib#trace#printf, string(join(msg))) + if len(a:vars) == len(a:values) + for i in range(1, len(a:vars) - 1) + let v = substitute(a:vars[i], ',$', '', '') + if type(a:values[i]) == v:t_func + let r = string(a:values[i]) + else + let r = a:values[i] + endif + if v =~# '^\([''"]\).\{-}\1$' + call add(msg, r .';') + else + call add(msg, v .'='. string(r) .';') + endif + unlet r + endfor + else + call add(msg, join(a:values[1:-1])) + endif + if type(g:tlib#trace#printer) == v:t_string + let printer = g:tlib#trace#printer + let args = [] + else + let [printer; args] = g:tlib#trace#printer + endif + call tlib#trace#Printer_{printer}(guard, join(msg), args) endif endf +function! tlib#trace#Reset() abort "{{{3 + let s:trace_rx = '^\%(error\|fatal\|warn\|info\)$' + let g:tlib#trace#printer = 'echom' +endf + + " Enable tracing via |:Tlibtrace|. function! tlib#trace#Enable() abort "{{{3 if !exists('s:trace_rx') - let s:trace_rx = '^\%(error\)$' + call tlib#trace#Reset() " :nodoc: command! -nargs=+ -bang Tlibtrace call tlib#trace#Print(expand(''), [], []) endif diff -Nru vim-tlib-1.20/autoload/tlib/type.vim vim-tlib-1.23/autoload/tlib/type.vim --- vim-tlib-1.20/autoload/tlib/type.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/type.vim 2017-03-16 19:32:34.000000000 +0000 @@ -2,8 +2,11 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-09-30. -" @Last Change: 2015-12-04. -" @Revision: 44 +" @Last Change: 2017-02-22. +" @Revision: 57 + + +let g:tlib#type#nil = [] " Enable type assertiona via |:Tlibtype|. @@ -20,6 +23,11 @@ endf +function! tlib#type#IsNil(expr) abort "{{{3 + return tlib#type#Is(a:expr, v:t_none) || a:expr is g:tlib#type#nil +endf + + function! tlib#type#IsNumber(expr) return tlib#type#Is(a:expr, 0) endf @@ -51,22 +59,30 @@ else if type(a:type) == 0 let type = a:type - elseif a:type =~? '^n\%[umber]' - let type = 0 - elseif a:type =~? '^s\%[tring]' - let type = 1 - elseif a:type =~? '^fu\%[ncref]' - let type = 2 - elseif a:type =~? '^l\%[ist]' - let type = 3 - elseif a:type =~? '^d\%[ictionary]' - let type = 4 - elseif a:type =~? '^fl\%[oat]' - let type = 5 + elseif a:type =~? '^b\%[oolean]$' + let type = v:t_bool + elseif a:type =~? '^c\%[hannel]$' + let type = v:t_channel + elseif a:type =~? '^d\%[ictionary]$' + let type = v:t_dict + elseif a:type =~? '^fl\%[oat]$' + let type = v:t_float + elseif a:type =~? '^fu\%[ncref]$' + let type = v:t_func + elseif a:type =~? '^j\%[ob]$' + let type = v:t_job + elseif a:type =~? '^l\%[ist]$' + let type = v:t_list + elseif a:type =~? '^\%(nil\|null\|none\)$' + let type = v:t_none + elseif a:type =~? '^n\%[umber]$' + let type = v:t_number + elseif a:type =~? '^s\%[tring]$' + let type = v:t_string else throw 'tlib#type#Is: Unknown type: ' a:type endif - " TLogVAR a:val, a:type, type, type(a:val), type(a:val) == a:type + Tlibtrace 'tlib', a:val, a:type, type, type(a:val), type(a:val) == a:type return type(a:val) == type endif endf @@ -86,13 +102,13 @@ function! tlib#type#Has(val, schema) abort "{{{3 - " TLogVAR type(a:val), type(a:schema) + Tlibtrace 'tlib', type(a:val), type(a:schema) if !tlib#type#IsDictionary(a:val) - " TLogVAR 'not a dictionary', a:val + Tlibtrace 'tlib', 'not a dictionary', a:val return 0 endif if tlib#type#IsString(a:schema) - " TLogVAR a:schema + Tlibtrace 'tlib', a:schema let schema = copy(s:schemas[a:schema]) else let schema = copy(a:schema) @@ -100,7 +116,7 @@ if tlib#type#IsDictionary(schema) return tlib#assert#All(map(schema, 'has_key(a:val, v:key) && tlib#type#Is(a:val[v:key], v:val)')) else - " TLogVAR keys(a:val), schema + Tlibtrace 'tlib', keys(a:val), schema return tlib#assert#All(map(schema, 'has_key(a:val, v:val)')) endif endf @@ -112,11 +128,11 @@ function! tlib#type#Check(caller, names, vals) abort "{{{3 - " TLogVAR a:names, a:vals, len(a:names) + Tlibtrace 'tlib', a:names, a:vals, len(a:names) for i in range(0, len(a:names) - 1, 2) let val = a:vals[i] let type = a:vals[i + 1] - " TLogVAR i, val, type + Tlibtrace 'tlib', i, val, type if !tlib#type#Is(val, type) let name = matchstr(a:names[i], '^''\zs.\{-}\ze'',\?$') throw 'tlib#type#Check: Type mismatch: '. name .':'. a:vals[i + 1] diff -Nru vim-tlib-1.20/autoload/tlib/win.vim vim-tlib-1.23/autoload/tlib/win.vim --- vim-tlib-1.20/autoload/tlib/win.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/win.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,7 +1,12 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 55 +" @Revision: 82 + + +if !exists('g:tlib#win#use_winid') + let g:tlib#win#use_winid = exists('*win_gotoid') && exists('*win_getid') "{{{2 +endif " Return vim code to jump back to the original window. @@ -20,6 +25,69 @@ endif return '' endf + + +if g:tlib#win#use_winid + let g:tlib#win#null_id = -1 + function! tlib#win#GetID() abort "{{{3 + return win_getid() + endf + function! tlib#win#GotoID(win_id) abort "{{{3 + call win_gotoid(a:win_id) + endf +else + let s:win_id = 0 + let g:tlib#win#null_id = {} + function! tlib#win#GetID() abort "{{{3 + if !exists('w:tlib_win_id') + let s:win_id += 1 + let w:tlib_win_id = s:win_id + endif + return {'tabpagenr': tabpagenr(), 'bufnr': bufnr('%'), 'winnr': winnr(), 'win_id': w:tlib_win_id} + endf + function! tlib#win#GotoID(win_id) abort "{{{3 + Tlibtrace 'tlib', a:win_id + if tabpagenr() != a:win_id.tabpagenr + exec 'tabnext' a:win_id.tabpagenr + endif + for wnr in range(1, winnr('$')) + let win_id = getwinvar(wnr, 'tlib_win_id', -1) + Tlibtrace 'tlib', wnr, win_id + if win_id == a:win_id.win_id + Tlibtrace 'tlib', wnr + exec wnr 'wincmd w' + return + endif + endfor + if winnr() != a:win_id.winnr + exec a:win_id.winnr 'wincmd w' + endif + if bufnr('%') != a:win_id.bufnr + exec 'buffer' a:win_id.bufnr + endif + endf +endif + + +" Return vim code to jump back to the original window. +function! tlib#win#SetById(win_id) "{{{3 + if a:win_id != g:tlib#win#null_id + let win_id = tlib#win#GetID() + call tlib#win#GotoID(a:win_id) + return printf('call tlib#win#GotoID(%s)', win_id) + " " TLogVAR a:winnr + " " TLogDBG winnr() + " " TLogDBG string(tlib#win#List()) + " if winnr() != a:winnr && winbufnr(a:winnr) != -1 + " let rv = winnr().'wincmd w' + " exec a:winnr .'wincmd w' + " " TLogVAR rv + " " TLogDBG string(tlib#win#List()) + " return rv + " endif + endif + return '' +endf " :def: function! tlib#win#GetLayout(?save_view=0) diff -Nru vim-tlib-1.20/autoload/tlib/World.vim vim-tlib-1.23/autoload/tlib/World.vim --- vim-tlib-1.20/autoload/tlib/World.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/autoload/tlib/World.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,7 +1,8 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 1434 +" @Revision: 1476 + " :filedoc: " A prototype used by |tlib#input#List|. @@ -12,9 +13,15 @@ " See |tlib#input#List()|. TLet g:tlib_inputlist_pct = 50 +" Max height for a horizontal list. +TLet g:tlib_inputlist_max_lines = -1 + +" Max width for a vertical list. +TLet g:tlib_inputlist_max_cols = -1 + " Size of filename columns when listing filenames. " See |tlib#input#List()|. -TLet g:tlib_inputlist_width_filename = '&co / 3' +TLet g:tlib_inputlist_width_filename = '&columns / 3' " TLet g:tlib_inputlist_width_filename = 25 " If true, |tlib#input#List()| will show some indicators about the @@ -92,7 +99,7 @@ \ 'timeout_resolution': 2, \ 'tabpagenr': -1, \ 'type': '', - \ 'win_wnr': -1, + \ 'win_id': g:tlib#win#null_id, \ 'win_height': -1, \ 'win_width': -1, \ 'win_pct': 25, @@ -100,7 +107,7 @@ " \ 'handlers': [], " \ 'filter_options': '\c', -function! tlib#World#New(...) +function! tlib#World#New(...) abort let object = s:prototype.New(a:0 >= 1 ? a:1 : {}) call object.SetMatchMode(tlib#var#Get('tlib#input#filter_mode', 'g', 'cnf')) return object @@ -108,8 +115,8 @@ " :nodoc: -function! s:prototype.Set_display_format(value) dict "{{{3 - if a:value == 'filename' +function! s:prototype.Set_display_format(value) dict abort "{{{3 + if a:value ==# 'filename' call self.Set_highlight_filename() let self.display_format = 'world.FormatFilename(%s)' else @@ -119,14 +126,14 @@ " :nodoc: -function! s:prototype.DisplayFormat(list) dict "{{{3 +function! s:prototype.DisplayFormat(list) dict abort "{{{3 let display_format = self.display_format if !empty(display_format) if has_key(self, 'InitFormatName') call self.InitFormatName() endif let cache = self.fmt_display - " TLogVAR display_format, fmt_entries + Tlibtrace 'tlib', display_format return map(copy(a:list), 'self.FormatName(cache, display_format, v:val)') else return a:list @@ -135,15 +142,15 @@ " :nodoc: -function! s:prototype.Set_highlight_filename() dict "{{{3 +function! s:prototype.Set_highlight_filename() dict abort "{{{3 let self.tlib_UseInputListScratch = 'call world.Highlight_filename()' endf -if g:tlib#input#format_filename == 'r' +if g:tlib#input#format_filename ==# 'r' " :nodoc: - function! s:prototype.Highlight_filename() dict "{{{3 + function! s:prototype.Highlight_filename() dict abort "{{{3 syntax match TLibDir /\s\+\zs.\{-}[\/]\ze[^\/]\+$/ hi def link TLibDir Directory syntax match TLibFilename /[^\/]\+$/ @@ -151,12 +158,12 @@ endf " :nodoc: - function! s:prototype.FormatFilename(file) dict "{{{3 + function! s:prototype.FormatFilename(file) dict abort "{{{3 if !has_key(self.fmt_options, 'maxlen') - let maxco = &co - len(len(self.base)) - eval(g:tlib#input#filename_padding_r) + let maxco = &columns - len(len(self.base)) - eval(g:tlib#input#filename_padding_r) let maxfi = max(map(copy(self.base), 'strwidth(v:val)')) let self.fmt_options.maxlen = min([maxco, maxfi]) - " TLogVAR maxco, maxfi, self.fmt_options.maxlen + Tlibtrace 'tlib', maxco, maxfi, self.fmt_options.maxlen endif let max = self.fmt_options.maxlen if len(a:file) > max @@ -170,16 +177,17 @@ else " :nodoc: - function! s:prototype.Highlight_filename() dict "{{{3 + function! s:prototype.Highlight_filename() dict abort "{{{3 " let self.width_filename = 1 + eval(g:tlib_inputlist_width_filename) - " TLogVAR self.base + Tlibtrace 'tlib', self.base let self.width_filename = min([ - \ get(self, 'width_filename', &co), - \ empty(g:tlib#input#filename_max_width) ? &co : eval(g:tlib#input#filename_max_width), + \ get(self, 'width_filename', &columns), + \ empty(g:tlib#input#filename_max_width) ? &columns : eval(g:tlib#input#filename_max_width), \ max(map(copy(self.base), 'strwidth(matchstr(v:val, "[^\\/]*$"))')) \ ]) " TLogVAR self.width_filename - exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' + " exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' + exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs[^&<>*|]*$/ contained containedin=TLibMarker contains=TLibFilename' exec 'syntax match TLibMarker /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \S.*$/ contains=TLibDir' " exec 'syntax match TLibDir /\(|\|\[.\{-}\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' " exec 'syntax match TLibMarker /\(|\|\[.\{-}\]\) \S.*$/ contains=TLibDir' @@ -188,7 +196,7 @@ hi def link TLibDir Directory hi def link TLibFilename NonText " :nodoc: - function! self.Highlighter(rx) dict + function! self.Highlighter(rx) dict abort let rx = '/\c\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) .\{-}\zs'. escape(a:rx, '/') .'/' exec 'match' self.matcher.highlight rx endf @@ -196,18 +204,18 @@ " :nodoc: - function! s:prototype.UseFilenameIndicators() dict "{{{3 + function! s:prototype.UseFilenameIndicators() dict abort "{{{3 return g:tlib_inputlist_filename_indicators || has_key(self, 'filename_indicators') endf " :nodoc: - function! s:prototype.InitFormatName() dict "{{{3 + function! s:prototype.InitFormatName() dict abort "{{{3 if self.UseFilenameIndicators() let self._buffers = {} for bufnr in range(1, bufnr('$')) let filename = fnamemodify(bufname(bufnr), ':p') - " TLogVAR filename + Tlibtrace 'tlib', filename let bufdef = { \ 'bufnr': bufnr, \ } @@ -222,8 +230,8 @@ " :nodoc: - function! s:prototype.FormatFilename(file) dict "{{{3 - " TLogVAR a:file + function! s:prototype.FormatFilename(file) dict abort "{{{3 + Tlibtrace 'tlib', a:file let width = self.width_filename let split = match(a:file, '[/\\]\zs[^/\\]\+$') if split == -1 @@ -237,9 +245,9 @@ if strwidth(fname) > width let fname = strpart(fname, 0, width - 3) .'...' endif - let dnmax = &co - max([width, strwidth(fname)]) - 8 - self.index_width - &fdc + let dnmax = &columns - max([width, strwidth(fname)]) - 8 - self.index_width - &foldcolumn let use_indicators = self.UseFilenameIndicators() - " TLogVAR use_indicators + Tlibtrace 'tlib', use_indicators let marker = [] if use_indicators call insert(marker, '[') @@ -247,7 +255,7 @@ let bufdef = get(self._buffers, a:file, {}) " let bnr = bufnr(a:file) let bnr = get(bufdef, 'bufnr', -1) - " TLogVAR a:file, bnr, self.bufnr + Tlibtrace 'tlib', a:file, bnr, self.bufnr if bnr != -1 if bnr == self.bufnr call add(marker, '%') @@ -257,7 +265,7 @@ if get(bufdef, '&modified', 0) call add(marker, '+') endif - if get(bufdef, '&bufhidden', '') == 'hide' + if get(bufdef, '&bufhidden', '') ==# 'hide' call add(marker, 'h') endif " if !get(bufdef, '&buflisted', 1) @@ -286,7 +294,7 @@ if strwidth(dname) > dnmax let dname = '...'. strpart(dname, len(dname) - dnmax) endif - return printf("%-*s %s %s", + return printf('%-*s %s %s', \ self.width_filename + len(fname) - strwidth(fname), \ fname, markers, dname) endf @@ -295,15 +303,15 @@ " :nodoc: -function! s:prototype.GetSelectedItems(current) dict "{{{3 - " TLogVAR a:current +function! s:prototype.GetSelectedItems(current) dict abort "{{{3 + Tlibtrace 'tlib', a:current if stridx(self.type, 'i') != -1 let rv = copy(self.sel_idx) else let rv = map(copy(self.sel_idx), 'self.GetBaseItem(v:val)') endif if !empty(a:current) - " TLogVAR a:current, rv, type(a:current) + Tlibtrace 'tlib', a:current, rv, type(a:current) if tlib#type#IsNumber(a:current) || tlib#type#IsString(a:current) call s:InsertSelectedItems(rv, a:current) elseif tlib#type#IsList(a:current) @@ -319,16 +327,16 @@ " TAssert empty(rv) || rv[0] == a:current if stridx(self.type, 'i') != -1 if !empty(self.index_table) - " TLogVAR rv, self.index_table + Tlibtrace 'tlib', rv, self.index_table call map(rv, 'self.index_table[v:val - 1]') - " TLogVAR rv + Tlibtrace 'tlib', rv endif endif return rv endf -function! s:InsertSelectedItems(rv, current) "{{{3 +function! s:InsertSelectedItems(rv, current) abort "{{{3 let ci = index(a:rv, a:current) if ci != -1 call remove(a:rv, ci) @@ -338,17 +346,17 @@ " :nodoc: -function! s:prototype.SelectItemsByNames(mode, items) dict "{{{3 +function! s:prototype.SelectItemsByNames(mode, items) dict abort "{{{3 for item in a:items let bi = index(self.base, item) + 1 - " TLogVAR item, bi + Tlibtrace 'tlib', item, bi if bi > 0 let si = index(self.sel_idx, bi) - " TLogVAR self.sel_idx - " TLogVAR si + Tlibtrace 'tlib', self.sel_idx + Tlibtrace 'tlib', si if si == -1 call add(self.sel_idx, bi) - elseif a:mode == 'toggle' + elseif a:mode ==# 'toggle' call remove(self.sel_idx, si) endif endif @@ -358,21 +366,21 @@ " :nodoc: -function! s:prototype.SelectItem(mode, index) dict "{{{3 - " TLogVAR a:mode, a:index +function! s:prototype.SelectItem(mode, index) dict abort "{{{3 + Tlibtrace 'tlib', a:mode, a:index let bi = self.GetBaseIdx(a:index) " if self.RespondTo('MaySelectItem') " if !self.MaySelectItem(bi) " return 0 " endif " endif - " TLogVAR bi + Tlibtrace 'tlib', bi let si = index(self.sel_idx, bi) - " TLogVAR self.sel_idx - " TLogVAR si + Tlibtrace 'tlib', self.sel_idx + Tlibtrace 'tlib', si if si == -1 call add(self.sel_idx, bi) - elseif a:mode == 'toggle' + elseif a:mode ==# 'toggle' call remove(self.sel_idx, si) endif return 1 @@ -388,26 +396,26 @@ " :nodoc: -function! s:prototype.FormatArgs(format_string, arg) dict "{{{3 +function! s:prototype.FormatArgs(format_string, arg) dict abort "{{{3 let nargs = len(substitute(a:format_string, '%%\|[^%]', '', 'g')) return [a:format_string] + repeat([string(a:arg)], nargs) endf " :nodoc: -function! s:prototype.GetRx(filter) dict "{{{3 - return '\('. join(filter(copy(a:filter), 'v:val[0] != "!"'), '\|') .'\)' +function! s:prototype.GetRx(filter) dict abort "{{{3 + return '\('. join(filter(copy(a:filter), 'v:val[0] !=# "!"'), '\|') .'\)' endf " :nodoc: -function! s:prototype.GetRx0(...) dict "{{{3 +function! s:prototype.GetRx0(...) dict abort "{{{3 exec tlib#arg#Let(['negative']) let rx0 = [] for filter in self.filter - " TLogVAR filter + Tlibtrace 'tlib', filter let rx = join(reverse(filter(copy(filter), '!empty(v:val)')), '\|') - " TLogVAR rx + Tlibtrace 'tlib', rx if !empty(rx) && (negative ? rx[0] == g:tlib#input#not : rx[0] != g:tlib#input#not) call add(rx0, rx) endif @@ -422,18 +430,16 @@ " :nodoc: -function! s:prototype.FormatName(cache, format, value) dict "{{{3 - " TLogVAR a:format, a:value - " TLogDBG has_key(self.fmt_display, a:value) +function! s:prototype.FormatName(cache, format, value) dict abort "{{{3 + Tlibtrace 'tlib', a:format, a:value if has_key(a:cache, a:value) - " TLogDBG "cached" return a:cache[a:value] else let world = self let ftpl = self.FormatArgs(a:format, a:value) - let fn = call(function("printf"), ftpl) + let fn = call(function('printf'), ftpl) let fmt = eval(fn) - " TLogVAR ftpl, fn, fmt + Tlibtrace 'tlib', ftpl, fn, fmt let a:cache[a:value] = fmt return fmt endif @@ -441,29 +447,29 @@ " :nodoc: -function! s:prototype.GetItem(idx) dict "{{{3 +function! s:prototype.GetItem(idx) dict abort "{{{3 return self.list[a:idx - 1] endf " :nodoc: -function! s:prototype.GetListIdx(baseidx) dict "{{{3 +function! s:prototype.GetListIdx(baseidx) dict abort "{{{3 " if empty(self.index_table) let baseidx = a:baseidx " else " let baseidx = 0 + self.index_table[a:baseidx - 1] - " " TLogVAR a:baseidx, baseidx, self.index_table + " Tlibtrace 'tlib', a:baseidx, baseidx, self.index_table " endif let rv = index(self.table, baseidx) - " TLogVAR rv, self.table + Tlibtrace 'tlib', rv, self.table return rv endf " :nodoc: " The first index is 1. -function! s:prototype.GetBaseIdx(idx) dict "{{{3 - " TLogVAR a:idx, self.table, self.index_table +function! s:prototype.GetBaseIdx(idx) dict abort "{{{3 + Tlibtrace 'tlib', a:idx, self.table, self.index_table if !empty(self.table) && a:idx > 0 && a:idx <= len(self.table) return self.table[a:idx - 1] else @@ -473,7 +479,7 @@ " :nodoc: -function! s:prototype.GetBaseIdx0(idx) dict "{{{3 +function! s:prototype.GetBaseIdx0(idx) dict abort "{{{3 let idx0 = self.GetBaseIdx(a:idx) - 1 if idx0 < 0 call tlib#notify#Echo('TLIB: Internal Error: GetBaseIdx0: idx0 < 0', 'WarningMsg') @@ -483,19 +489,19 @@ " :nodoc: -function! s:prototype.GetBaseItem(idx) dict "{{{3 +function! s:prototype.GetBaseItem(idx) dict abort "{{{3 return self.base[a:idx - 1] endf " :nodoc: -function! s:prototype.SetBaseItem(idx, item) dict "{{{3 +function! s:prototype.SetBaseItem(idx, item) dict abort "{{{3 let self.base[a:idx - 1] = a:item endf " :nodoc: -function! s:prototype.GetLineIdx(lnum) dict "{{{3 +function! s:prototype.GetLineIdx(lnum) dict abort "{{{3 let line = getline(a:lnum) let prefidx = substitute(matchstr(line, '^\d\+\ze[*:]'), '^0\+', '', '') return prefidx @@ -503,25 +509,24 @@ " :nodoc: -function! s:prototype.SetPrefIdx() dict "{{{3 +function! s:prototype.SetPrefIdx() dict abort "{{{3 " let pref = sort(range(1, self.llen), 'self.SortPrefs') " let self.prefidx = get(pref, 0, self.initial_index) let pref_idx = -1 let pref_weight = -1 - " TLogVAR self.filter_pos, self.filter_neg - " let t0 = localtime() " DBG + Tlibtrace 'tlib', self.filter_pos, self.filter_neg + let t0 = localtime() for idx in range(1, self.llen) let item = self.GetItem(idx) let weight = self.matcher.AssessName(self, item) - " TLogVAR item, weight + Tlibtrace 'tlib', item, weight if weight > pref_weight let pref_idx = idx let pref_weight = weight endif endfor - " TLogVAR localtime() - t0 - " TLogVAR pref_idx - " TLogDBG self.GetItem(pref_idx) + Tlibtrace 'tlib', localtime() - t0 + Tlibtrace 'tlib', pref_idx if pref_idx == -1 let self.prefidx = self.initial_index else @@ -531,16 +536,16 @@ " " :nodoc: -" function! s:prototype.GetCurrentItem() dict "{{{3 +" function! s:prototype.GetCurrentItem() dict abort "{{{3 " let idx = self.prefidx -" " TLogVAR idx +" Tlibtrace 'tlib', idx " if stridx(self.type, 'i') != -1 " return idx " elseif !empty(self.list) " if len(self.list) >= idx " let idx1 = idx - 1 " let rv = self.list[idx - 1] -" " TLogVAR idx, idx1, rv, self.list +" Tlibtrace 'tlib', idx, idx1, rv, self.list " return rv " endif " else @@ -550,19 +555,19 @@ " :nodoc: -function! s:prototype.CurrentItem() dict "{{{3 +function! s:prototype.CurrentItem() dict abort "{{{3 if stridx(self.type, 'i') != -1 return self.GetBaseIdx(self.llen == 1 ? 1 : self.prefidx) else if self.llen == 1 - " TLogVAR self.llen + Tlibtrace 'tlib', self.llen return self.list[0] elseif self.prefidx > 0 - " TLogVAR self.prefidx + Tlibtrace 'tlib', self.prefidx " return self.GetCurrentItem() if len(self.list) >= self.prefidx let rv = self.list[self.prefidx - 1] - " TLogVAR idx, rv, self.list + Tlibtrace 'tlib', self.prefidx, len(self.list), rv return rv endif else @@ -573,29 +578,29 @@ " :nodoc: -function! s:prototype.FilterRxPrefix() dict "{{{3 +function! s:prototype.FilterRxPrefix() dict abort "{{{3 return self.matcher.FilterRxPrefix() endf " :nodoc: -function! s:prototype.SetFilter() dict "{{{3 +function! s:prototype.SetFilter() dict abort "{{{3 " let mrx = '\V'. (a:0 >= 1 && a:1 ? '\C' : '') let mrx = self.FilterRxPrefix() . self.filter_options let self.filter_pos = [] let self.filter_neg = [] - " TLogVAR mrx, self.filter + Tlibtrace 'tlib', mrx, self.filter for filter in self.filter - " TLogVAR filter + Tlibtrace 'tlib', filter let rx = join(reverse(filter(copy(filter), '!empty(v:val)')), '\|') - " TLogVAR rx + Tlibtrace 'tlib', rx if !empty(rx) - if rx =~ '\u' + if rx =~# '\u' let mrx1 = mrx .'\C' else let mrx1 = mrx endif - " TLogVAR rx + Tlibtrace 'tlib', rx if rx[0] == g:tlib#input#not if len(rx) > 1 call add(self.filter_neg, mrx1 .'\('. rx[1:-1] .'\)') @@ -605,17 +610,17 @@ endif endif endfor - " TLogVAR self.filter_pos, self.filter_neg + Tlibtrace 'tlib', self.filter_pos, self.filter_neg endf " :nodoc: -function! s:prototype.IsValidFilter() dict "{{{3 +function! s:prototype.IsValidFilter() dict abort "{{{3 let last = self.FilterRxPrefix() .'\('. self.filter[0][0] .'\)' Tlibtrace 'tlib', last - " TLogVAR last + Tlibtrace 'tlib', last try - let a = match("", last) + let a = match('', last) return 1 catch Tlibtrace 'tlib', v:exception @@ -625,8 +630,8 @@ " :nodoc: -function! s:prototype.SetMatchMode(match_mode) dict "{{{3 - " TLogVAR a:match_mode +function! s:prototype.SetMatchMode(match_mode) dict abort "{{{3 + Tlibtrace 'tlib', a:match_mode if !empty(a:match_mode) unlet self.matcher try @@ -639,31 +644,31 @@ endf -" function! s:prototype.Match(text) dict "{{{3 +" function! s:prototype.Match(text) dict abort "{{{3 " return self.matcher.Match(self, text) " endf " :nodoc: -function! s:prototype.MatchBaseIdx(idx) dict "{{{3 +function! s:prototype.MatchBaseIdx(idx) dict abort "{{{3 let text = self.GetBaseItem(a:idx) if !empty(self.filter_format) let text = self.FormatName(self.fmt_filter, self.filter_format, text) endif - " TLogVAR text + Tlibtrace 'tlib', text " return self.Match(text) return self.matcher.Match(self, text) endf " :nodoc: -function! s:prototype.BuildTableList() dict "{{{3 - " let time0 = str2float(reltimestr(reltime())) " DBG - " TLogVAR time0 +function! s:prototype.BuildTableList() dict abort "{{{3 + let time0 = str2float(reltimestr(reltime())) + Tlibtrace 'tlib', time0 call self.SetFilter() - " TLogVAR self.filter_neg, self.filter_pos + Tlibtrace 'tlib', self.filter_neg, self.filter_pos let self.table = range(1, len(self.base)) - " TLogVAR self.filtered_items + Tlibtrace 'tlib', self.filtered_items let copy_base = 1 if !empty(self.filtered_items) let self.table = filter(self.table, 'index(self.filtered_items, v:val) != -1') @@ -682,8 +687,8 @@ " :nodoc: -function! s:prototype.ReduceFilter() dict "{{{3 - " TLogVAR self.filter +function! s:prototype.ReduceFilter() dict abort "{{{3 + Tlibtrace 'tlib', self.filter let reduced = 0 while !reduced if self.filter[0] == [''] && len(self.filter) > 1 @@ -702,7 +707,7 @@ " :nodoc: " filter is either a string or a list of list of strings. -function! s:prototype.SetInitialFilter(filter) dict "{{{3 +function! s:prototype.SetInitialFilter(filter) dict abort "{{{3 " let self.initial_filter = [[''], [a:filter]] Tlibtrace 'tlib', a:filter if type(a:filter) == 3 @@ -714,8 +719,8 @@ " :nodoc: -function! s:prototype.PopFilter() dict "{{{3 - " TLogVAR self.filter +function! s:prototype.PopFilter() dict abort "{{{3 + Tlibtrace 'tlib', self.filter if len(self.filter[0]) > 1 call remove(self.filter[0], 0) elseif len(self.filter) > 1 @@ -727,17 +732,17 @@ " :nodoc: -function! s:prototype.FilterIsEmpty() dict "{{{3 - " TLogVAR self.filter +function! s:prototype.FilterIsEmpty() dict abort "{{{3 + Tlibtrace 'tlib', self.filter return self.filter == copy(self.initial_filter) endf " :nodoc: -function! s:prototype.DisplayFilter() dict "{{{3 +function! s:prototype.DisplayFilter() dict abort "{{{3 let filter1 = copy(self.filter) call filter(filter1, 'v:val != [""]') - " TLogVAR self.matcher['_class'] + Tlibtrace 'tlib', self.matcher['_class'] let rv = self.matcher.DisplayFilter(filter1) let rv = self.CleanFilter(rv) return rv @@ -745,29 +750,29 @@ " :nodoc: -function! s:prototype.SetFrontFilter(pattern) dict "{{{3 +function! s:prototype.SetFrontFilter(pattern) dict abort "{{{3 call self.matcher.SetFrontFilter(self, a:pattern) endf " :nodoc: -function! s:prototype.PushFrontFilter(char) dict "{{{3 +function! s:prototype.PushFrontFilter(char) dict abort "{{{3 call self.matcher.PushFrontFilter(self, a:char) endf " :nodoc: -function! s:prototype.CleanFilter(filter) dict "{{{3 +function! s:prototype.CleanFilter(filter) dict abort "{{{3 return self.matcher.CleanFilter(a:filter) endf " :nodoc: -function! s:prototype.UseScratch() dict "{{{3 +function! s:prototype.UseScratch() dict abort "{{{3 " if type(self.scratch) != 0 && get(self, 'buffer_local', 1) " if self.scratch != fnamemodify(self.scratch, ':p') " let self.scratch = tlib#file#Join([expand('%:p:h'), self.scratch]) - " " TLogVAR self.scratch + " Tlibtrace 'tlib', self.scratch " endif " " let self.scratch_hidden = 'wipe' " endif @@ -780,15 +785,15 @@ " :nodoc: -function! s:prototype.CloseScratch(...) dict "{{{3 +function! s:prototype.CloseScratch(...) dict abort "{{{3 TVarArg ['reset_scratch', 0] " TVarArg ['reset_scratch', 1] - " TLogVAR reset_scratch + Tlibtrace 'tlib', reset_scratch if self.sticky return 0 else let rv = tlib#scratch#CloseScratch(self, reset_scratch) - " TLogVAR rv + Tlibtrace 'tlib', rv if rv call self.SwitchWindow('win') endif @@ -798,7 +803,7 @@ " :nodoc: -function! s:prototype.Initialize() dict "{{{3 +function! s:prototype.Initialize() dict abort "{{{3 let self.initialized = 1 call self.SetOrigin(1) call self.Reset(1) @@ -812,7 +817,7 @@ " :nodoc: -function! s:prototype.Leave() dict "{{{3 +function! s:prototype.Leave() dict abort "{{{3 if !empty(self.cache_var) exec 'let '. self.cache_var .' = self' endif @@ -823,7 +828,7 @@ " :nodoc: -function! s:prototype.UseInputListScratch() dict "{{{3 +function! s:prototype.UseInputListScratch() dict abort "{{{3 let scratch = self.UseScratch() if !exists('b:tlib_list_init') call tlib#autocmdgroup#Init() @@ -832,7 +837,7 @@ let b:tlib_list_init = 1 endif if !exists('w:tlib_list_init') - " TLogVAR scratch + Tlibtrace 'tlib', scratch if has_key(self, 'index_next_syntax') if type(self.index_next_syntax) == 1 exec 'syntax match InputlListIndex /^\d\+:\s/ nextgroup='. self.index_next_syntax @@ -864,9 +869,9 @@ " s:prototype.Reset(?initial=0) " :nodoc: -function! s:prototype.Reset(...) dict "{{{3 +function! s:prototype.Reset(...) dict abort "{{{3 TVarArg ['initial', 0] - " TLogVAR initial + Tlibtrace 'tlib', initial Tlibtrace 'tlib', initial, self.initial_filter let self.state = 'display' let self.offset = 1 @@ -885,23 +890,22 @@ " :nodoc: -function! s:prototype.ResetSelected() dict "{{{3 +function! s:prototype.ResetSelected() dict abort "{{{3 let self.sel_idx = [] endf " :nodoc: -function! s:prototype.Retrieve(anyway) dict "{{{3 - " TLogVAR a:anyway, self.base - " TLogDBG (a:anyway || empty(self.base)) +function! s:prototype.Retrieve(anyway) dict abort "{{{3 + Tlibtrace 'tlib', a:anyway, self.base if (a:anyway || empty(self.base)) let ra = self.retrieve_eval - " TLogVAR ra + Tlibtrace 'tlib', ra if !empty(ra) let back = self.SwitchWindow('win') let world = self let self.base = eval(ra) - " TLogVAR self.base + Tlibtrace 'tlib', self.base exec back return 1 endif @@ -910,25 +914,25 @@ endf -function! s:FormatHelp(help) "{{{3 - " TLogVAR a:help +function! s:FormatHelp(help) abort "{{{3 + Tlibtrace 'tlib', a:help let max = [0, 0] for item in a:help - " TLogVAR item + Tlibtrace 'tlib', item if type(item) == 3 let itemlen = map(copy(item), 'strwidth(v:val)') - " TLogVAR itemlen + Tlibtrace 'tlib', itemlen let max = map(range(2), 'max[v:val] >= itemlen[v:val] ? max[v:val] : itemlen[v:val]') endif unlet item endfor - " TLogVAR max + Tlibtrace 'tlib', max let cols = float2nr((winwidth(0) - &foldcolumn - 1) / (max[0] + max[1] + 2)) if cols < 1 let cols = 1 endif let fmt = printf('%%%ds: %%-%ds', max[0], max[1]) - " TLogVAR cols, fmt + Tlibtrace 'tlib', cols, fmt let help = [] let idx = -1 let maxidx = len(a:help) @@ -956,31 +960,31 @@ call add(help, a:help[idx]) endif endwh - " TLogVAR help + Tlibtrace 'tlib', help return help endf -function! s:FormatHelpItem(item, fmt) "{{{3 +function! s:FormatHelpItem(item, fmt) abort "{{{3 let args = [join(repeat([a:fmt], len(a:item)), ' ')] for item in a:item - " TLogVAR item + Tlibtrace 'tlib', item let args += item endfor - " TLogVAR args + Tlibtrace 'tlib', args return call('printf', args) endf " :nodoc: -function! s:prototype.InitHelp() dict "{{{3 +function! s:prototype.InitHelp() dict abort "{{{3 return [] endf " :nodoc: -function! s:prototype.PushHelp(...) dict "{{{3 - " TLogVAR a:000 +function! s:prototype.PushHelp(...) dict abort "{{{3 + Tlibtrace 'tlib', a:000 if a:0 == 1 if type(a:1) == 3 let self.temp_lines += a:1 @@ -990,14 +994,14 @@ elseif a:0 == 2 call add(self.temp_lines, a:000) else - throw "TLIB: PushHelp: Wrong number of arguments: ". string(a:000) + throw 'TLIB: PushHelp: Wrong number of arguments: '. string(a:000) endif - " TLogVAR helpstring + Tlibtrace 'tlib', helpstring endf " :nodoc: -function! s:prototype.DisplayHelp() dict "{{{3 +function! s:prototype.DisplayHelp() dict abort "{{{3 let self.temp_lines = self.InitHelp() call self.PushHelp('', self.key_mode == 'default' ? 'Abort' : 'Reset keymap') call self.PushHelp('Enter, ', 'Pick the current item') @@ -1026,14 +1030,14 @@ endif endif - " TLogVAR len(self.temp_lines) + Tlibtrace 'tlib', len(self.temp_lines) call self.matcher.Help(self) - " TLogVAR self.key_mode + Tlibtrace 'tlib', self.key_mode for handler in values(self.key_map[self.key_mode]) - " TLogVAR handler + Tlibtrace 'tlib', handler let key = get(handler, 'key_name', '') - " TLogVAR key + Tlibtrace 'tlib', key if !empty(key) let desc = get(handler, 'help', '') if empty(desc) @@ -1051,7 +1055,7 @@ call self.PushHelp(self.help_extra) endif - " TLogVAR len(self.temp_lines) + Tlibtrace 'tlib', len(self.temp_lines) call self.PushHelp([ \ '', \ 'Matches at word boundaries are prioritized.', @@ -1061,7 +1065,7 @@ endf -function! s:prototype.PrintLines() dict "{{{3 +function! s:prototype.PrintLines() dict abort "{{{3 let self.temp_prompt = ['Press any key to continue.', 'Question'] call tlib#buffer#DeleteRange('1', '$') call append(0, self.temp_lines) @@ -1073,31 +1077,35 @@ " :nodoc: -function! s:prototype.Resize(hsize, vsize) dict "{{{3 - " TLogVAR self.scratch_vertical, a:hsize, a:vsize +function! s:prototype.Resize(hsize, vsize) dict abort "{{{3 + Tlibtrace 'tlib', self.scratch_vertical, a:hsize, a:vsize let world_resize = '' let winpos = '' let scratch_split = get(self, 'scratch_split', 1) - " TLogVAR scratch_split + Tlibtrace 'tlib', scratch_split if scratch_split > 0 if self.scratch_vertical if a:vsize let world_resize = 'vert resize '. a:vsize let winpos = tlib#fixes#Winpos() " let w:winresize = {'v': a:vsize} - setlocal winfixwidth + " setlocal winfixwidth endif else if a:hsize let world_resize = 'resize '. a:hsize " let w:winresize = {'h': a:hsize} - setlocal winfixheight + " setlocal winfixheight endif endif endif if !empty(world_resize) - " TLogVAR world_resize, winpos + Tlibtrace 'tlib', world_resize, winpos + setlocal nowinfixheight + setlocal nowinfixwidth exec world_resize + setlocal winfixheight + setlocal winfixwidth if !empty(winpos) exec winpos endif @@ -1107,31 +1115,36 @@ " :nodoc: -function! s:prototype.GetResize(size) dict "{{{3 +function! s:prototype.GetResize(size) dict abort "{{{3 let resize0 = get(self, 'resize', 0) let resize = empty(resize0) ? 0 : eval(resize0) - " TLogVAR resize0, resize + Tlibtrace 'tlib', resize0, resize let resize = resize == 0 ? a:size : min([a:size, resize]) " let min = self.scratch_vertical ? &cols : &lines let min1 = (self.scratch_vertical ? self.win_width : self.win_height) * g:tlib_inputlist_pct let min2 = (self.scratch_vertical ? &columns : &lines) * self.win_pct + let min3 = &previewheight let min = max([min1, min2]) - let resize = min([resize, (min / 100)]) - " TLogVAR resize, a:size, min, min1, min2 + let ns = [resize, (min / 100)] + let maxn = self.scratch_vertical ? g:tlib_inputlist_max_cols : g:tlib_inputlist_max_lines + if maxn > 0 + call add(ns, maxn) + endif + let resize = min(ns) + Tlibtrace 'tlib', resize, a:size, min, min1, min2 return resize endf " function! s:prototype.DisplayList(?query=self.Query(), ?list=[]) " :nodoc: -function! s:prototype.DisplayList(...) dict "{{{3 - " TLogVAR self.state +function! s:prototype.DisplayList(...) dict abort "{{{3 + Tlibtrace 'tlib', self.state let query = a:0 >= 1 ? a:1 : self.Query() let list = a:0 >= 2 ? a:2 : [] - " TLogVAR query, len(list) - " TLogDBG 'len(list) = '. len(list) + Tlibtrace 'tlib', query, len(list) call self.UseScratch() - " TLogVAR self.scratch + Tlibtrace 'tlib', self.scratch " TAssert IsNotEmpty(self.scratch) if self.state == 'scroll' call self.ScrollToOffset() @@ -1142,12 +1155,12 @@ call self.PrintLines() call self.SetStatusline(query) else - " TLogVAR query + Tlibtrace 'tlib', query " let ll = len(list) let ll = self.llen " let x = len(ll) + 1 let x = self.index_width + 1 - " TLogVAR ll + Tlibtrace 'tlib', ll if self.state =~ '\' call self.Resize(self.GetResize(ll), eval(get(self, 'resize_vertical', 0))) call tlib#normal#WithRegister('gg"tdG', 't') @@ -1156,16 +1169,16 @@ let w = winwidth(0) - &fdc " let w = winwidth(0) - &fdc - 1 let lines = map(lines, 'printf("%-'. w .'.'. w .'s", v:val)') - " TLogVAR lines + Tlibtrace 'tlib', lines call append(0, lines) call tlib#normal#WithRegister('G"tddgg', 't') endif - " TLogVAR self.prefidx + Tlibtrace 'tlib', self.prefidx let base_pref = self.GetBaseIdx(self.prefidx) - " TLogVAR base_pref + Tlibtrace 'tlib', base_pref if self.state =~ '\' call filter(b:tlibDisplayListMarks, 'index(self.sel_idx, v:val) == -1 && v:val != base_pref') - " TLogVAR b:tlibDisplayListMarks + Tlibtrace 'tlib', b:tlibDisplayListMarks call map(b:tlibDisplayListMarks, 'self.DisplayListMark(x, v:val, ":")') " let b:tlibDisplayListMarks = map(copy(self.sel_idx), 'self.DisplayListMark(x, v:val, "#")') " call add(b:tlibDisplayListMarks, self.prefidx) @@ -1176,10 +1189,10 @@ call self.DisplayListMark(x, base_pref, '*') call self.SetOffset() call self.SetStatusline(query) - " TLogVAR self.offset + Tlibtrace 'tlib', self.offset call self.ScrollToOffset() let rx0 = self.GetRx0() - " TLogVAR rx0 + Tlibtrace 'tlib', rx0 if !empty(self.matcher.highlight) if empty(rx0) match none @@ -1197,8 +1210,8 @@ " :nodoc: -function! s:prototype.SetStatusline(query) dict "{{{3 - " TLogVAR a:query +function! s:prototype.SetStatusline(query) dict abort "{{{3 + Tlibtrace 'tlib', a:query if !empty(self.temp_prompt) let echo = get(self.temp_prompt, 0, '') let hl = get(self.temp_prompt, 1, 'Normal') @@ -1226,7 +1239,7 @@ let echo = query . ' ' . sopts " let query .= '%%='. sopts .' ' endif - " TLogVAR &l:statusline, query + Tlibtrace 'tlib', &l:statusline, query " let &l:statusline = query endif echo @@ -1241,7 +1254,7 @@ " :nodoc: -function! s:prototype.Query() dict "{{{3 +function! s:prototype.Query() dict abort "{{{3 let flt = self.DisplayFilter() if g:tlib_inputlist_shortmessage let query = 'Filter: '. flt @@ -1253,17 +1266,15 @@ " :nodoc: -function! s:prototype.ScrollToOffset() dict "{{{3 - " TLogVAR self.scratch_vertical, self.llen, winheight(0) +function! s:prototype.ScrollToOffset() dict abort "{{{3 + Tlibtrace 'tlib', self.scratch_vertical, self.llen, winheight(0) exec 'norm! '. self.offset .'zt' endf " :nodoc: -function! s:prototype.SetOffset() dict "{{{3 - " TLogVAR self.prefidx, self.offset - " TLogDBG winheight(0) - " TLogDBG self.prefidx > self.offset + winheight(0) - 1 +function! s:prototype.SetOffset() dict abort "{{{3 + Tlibtrace 'tlib', self.prefidx, self.offset let listtop = len(self.list) - winheight(0) + 1 if listtop < 1 let listtop = 1 @@ -1274,37 +1285,34 @@ let listoff = self.prefidx - winheight(0) + 1 let self.offset = min([listtop, listoff]) " TLogVAR self.prefidx - " TLogDBG len(self.list) - " TLogDBG winheight(0) " TLogVAR listtop, listoff, self.offset elseif self.prefidx < self.offset let self.offset = self.prefidx endif - " TLogVAR self.offset + Tlibtrace 'tlib', self.offset endf " :nodoc: -function! s:prototype.ClearAllMarks() dict "{{{3 +function! s:prototype.ClearAllMarks() dict abort "{{{3 let x = self.index_width + 1 call map(range(1, line('$')), 'self.DisplayListMark(x, v:val, ":")') endf " :nodoc: -function! s:prototype.MarkCurrent(y) dict "{{{3 +function! s:prototype.MarkCurrent(y) dict abort "{{{3 let x = self.index_width + 1 call self.DisplayListMark(x, a:y, '*') endf " :nodoc: -function! s:prototype.DisplayListMark(x, y, mark) dict "{{{3 - " TLogVAR a:y, a:mark +function! s:prototype.DisplayListMark(x, y, mark) dict abort "{{{3 + Tlibtrace 'tlib', a:y, a:mark if a:x > 0 && a:y >= 0 - " TLogDBG a:x .'x'. a:y .' '. a:mark let sy = self.GetListIdx(a:y) + 1 - " TLogVAR sy + Tlibtrace 'tlib', sy if sy >= 1 call setpos('.', [0, sy, a:x, 0]) exec 'norm! r'. a:mark @@ -1316,23 +1324,22 @@ " :nodoc: -function! s:prototype.SwitchWindow(where) dict "{{{3 - " TLogDBG string(tlib#win#List()) - if self.tabpagenr != tabpagenr() - call tlib#tab#Set(self.tabpagenr) - endif - let wnr = get(self, a:where.'_wnr') - " TLogVAR self, wnr - return tlib#win#Set(wnr) +function! s:prototype.SwitchWindow(where) dict abort "{{{3 + " if self.tabpagenr != tabpagenr() + " call tlib#tab#Set(self.tabpagenr) + " endif + " let wnr = get(self, a:where.'_wnr') + " Tlibtrace 'tlib', self, wnr + " return tlib#win#Set(wnr) + return tlib#win#SetById(self[a:where .'_id']) endf " :nodoc: -function! s:prototype.FollowCursor() dict "{{{3 +function! s:prototype.FollowCursor() dict abort "{{{3 if !empty(self.follow_cursor) let back = self.SwitchWindow('win') - " TLogVAR back - " TLogDBG winnr() + Tlibtrace 'tlib', back try call call(self.follow_cursor, [self, [self.CurrentItem()]]) finally @@ -1343,62 +1350,47 @@ " :nodoc: -function! s:prototype.SetOrigin(...) dict "{{{3 +function! s:prototype.SetOrigin(...) dict abort "{{{3 TVarArg ['winview', 0] - " TLogVAR self.win_wnr, self.bufnr - " TLogDBG bufname('%') - " TLogDBG winnr() - " TLogDBG winnr('$') + Tlibtrace 'tlib', 'SetOrigin', self.win_id, self.bufnr, bufnr('%'), winnr() let self.win_wnr = winnr() + let self.win_id = tlib#win#GetID() let self.win_height = winheight(self.win_wnr) let self.win_width = winwidth(self.win_wnr) - " TLogVAR self.win_wnr, self.win_height, self.win_width + Tlibtrace 'tlib', 'SetOrigin', self.win_id, self.win_height, self.win_width, bufnr('%'), winnr() let self.bufnr = bufnr('%') let self.tabpagenr = tabpagenr() let self.cursor = getpos('.') if winview let self.winview = tlib#win#GetLayout() endif - " TLogVAR self.win_wnr, self.bufnr, self.winview + Tlibtrace 'tlib', 'SetOrigin', self.win_id, self.bufnr, self.winview return self endf " :nodoc: -function! s:prototype.RestoreOrigin(...) dict "{{{3 +function! s:prototype.RestoreWindow(...) dict abort "{{{3 TVarArg ['winview', 0] if winview - " TLogVAR winview + Tlibtrace 'tlib', winview call tlib#win#SetLayout(self.winview) endif - " TLogVAR self.win_wnr, self.bufnr, self.cursor, &splitbelow - " TLogDBG "RestoreOrigin0 ". string(tlib#win#List()) - " If &splitbelow or &splitright is false, we cannot rely on - " self.win_wnr to be our source buffer since, e.g, opening a buffer - " in a split window changes the whole layout. - " Possible solutions: - " - Restrict buffer switching to cases when the number of windows - " hasn't changed. - " - Guess the right window, which we try to do here. - if &splitbelow == 0 || &splitright == 0 - let wn = bufwinnr(self.bufnr) - " TLogVAR wn - if wn == -1 - let wn = 1 - end - else - let wn = self.win_wnr - endif - if wn != winnr() - exec wn .'wincmd w' + call tlib#win#GotoID(self.win_id) +endf + + +" :nodoc: +function! s:prototype.RestoreOrigin(...) dict abort "{{{3 + call call(self.RestoreWindow, a:000) + if bufnr('%') != self.bufnr + exec 'buffer! '. self.bufnr + call setpos('.', self.cursor) endif - exec 'buffer! '. self.bufnr - call setpos('.', self.cursor) - " TLogDBG "RestoreOrigin1 ". string(tlib#win#List()) endf -function! s:prototype.Suspend() dict "{{{3 +function! s:prototype.Suspend() dict abort "{{{3 call tlib#agent#Suspend(self, self.rv) endf diff -Nru vim-tlib-1.20/CHANGES.TXT vim-tlib-1.23/CHANGES.TXT --- vim-tlib-1.20/CHANGES.TXT 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/CHANGES.TXT 2017-03-16 19:32:34.000000000 +0000 @@ -734,3 +734,68 @@ MD5 checksum: c3a1fe7d3cd86becbd3f7b0ba7ae9cd8 version: "1.19" +version: "1.20" + - tlib#arg: Completion for comma-separated lists + - Use "silent cd" + - NEW tlib#type#DefSchema(); FIX tlib#type#Has() + - tlib#cache#Value(): minor change + - tlib#date#IsDate() also checks whether the date is valid + - ! tlib#sys#Open(): escape special chars only once + - tlib#trace#Print: Allow for strings + - :Tlibtrace, :Tlibtraceset, :Tlibassert remove `-bar` + - NEW :Tlibtype (type/schema assertions); tlib#type#Is() also accepts schemas as "types" + - tlib#dir#CD(): Use haslocaldir() + - tlib#qfl#AgentGotoQFE: Don't use wincmd w + - NEW tlib#string#Input() + - FIX g:tlib#sys#system_rx; add OpenOffice exensions to g:tlib#sys#special_suffixes + - NEW tlib#selection#GetSelection() + - tlib#date#Shift(): Fix "Xm", ++specs + - tlib#trace#Set: FIX Properly handly "-label" + MD5 checksum: c919e0782931a8c628c6996903f989d3 + + - tlib#date#Shift(): Support for business days 'Nb' + - tlib#list#Uniq: Properly handle empty strings + - tlib#trace: Use g:tlib#trace#printer and tlib#trace#Printer_{printer} + - tlib#dictionary#Rev: Optional argument `opts = {}`; properly handle empty values etc. + - NEW g:tlib#trace#hl + - NEW spec/dictionary.vim + - tlib#agent#CompleteAgentNames: case insensitive + - tlib#arg#CComplete: --[no-]debug option + - tlib#date#Format: use localtime() if no arg is provided + - NEW tlib#file#IsAbsolute + - NEW tlib#notify#PrintError() + - tlib#trace#Print: FIX s/exec/call/ + - tlib#type#Is() match full type name + - NEW tlib#string#MatchAll() + - Tlibtraceset, tlib#trace#Set(): If no `+` or `-` is prepended, assume `+`. + - tlib#list#Input: fix highlighting for filenames + - tlib#input#ListW: use world.CloseScratch(1) + - tlib#agent#ViewFile: Ignore errors in :exec back + - NEW tlib#agent#EditFileInWindow() + - :Tlibtraceset uses tlib#arg#GetOpts(), i.e. you can set the log file more easily + MD5 checksum: 20a48e225f32b9f58808096a5377af04 +version: "1.22" + + - tlib#date#Shift(): Support for business days 'Nb' + - tlib#list#Uniq: Properly handle empty strings + - tlib#trace: Use g:tlib#trace#printer and tlib#trace#Printer_{printer} + - tlib#dictionary#Rev: Optional argument `opts = {}`; properly handle empty values etc. + - NEW g:tlib#trace#hl + - NEW spec/dictionary.vim + - tlib#agent#CompleteAgentNames: case insensitive + - tlib#arg#CComplete: --[no-]debug option + - tlib#date#Format: use localtime() if no arg is provided + - NEW tlib#file#IsAbsolute + - NEW tlib#notify#PrintError() + - tlib#trace#Print: FIX s/exec/call/ + - tlib#type#Is() match full type name + - NEW tlib#string#MatchAll() + - Tlibtraceset, tlib#trace#Set(): If no `+` or `-` is prepended, assume `+`. + - tlib#list#Input: fix highlighting for filenames + - tlib#input#ListW: use world.CloseScratch(1) + - tlib#agent#ViewFile: Ignore errors in :exec back + - NEW tlib#agent#EditFileInWindow() + - :Tlibtraceset uses tlib#arg#GetOpts(), i.e. you can set the log file more easily + MD5 checksum: 20a48e225f32b9f58808096a5377af04 +version: "1.22" + diff -Nru vim-tlib-1.20/debian/changelog vim-tlib-1.23/debian/changelog --- vim-tlib-1.20/debian/changelog 2016-02-13 13:34:23.000000000 +0000 +++ vim-tlib-1.23/debian/changelog 2018-01-08 18:35:20.000000000 +0000 @@ -1,3 +1,10 @@ +vim-tlib (1.23-1) unstable; urgency=medium + + * New upstream release + * Standard version bumped to 4.1.3 + + -- Andrea Capriotti Mon, 08 Jan 2018 19:35:20 +0100 + vim-tlib (1.20-1) unstable; urgency=medium * New upstream release diff -Nru vim-tlib-1.20/debian/control vim-tlib-1.23/debian/control --- vim-tlib-1.20/debian/control 2016-02-13 13:33:26.000000000 +0000 +++ vim-tlib-1.23/debian/control 2018-01-08 14:36:03.000000000 +0000 @@ -3,7 +3,7 @@ Priority: extra Maintainer: Andrea Capriotti Build-Depends: debhelper (>= 9.0.0) -Standards-Version: 3.9.7 +Standards-Version: 4.1.3 Homepage: http://www.vim.org/scripts/script.php?script_id=1863 Vcs-Git: git://anonscm.debian.org/collab-maint/vim-tlib.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=collab-maint/vim-tlib.git;a=summary diff -Nru vim-tlib-1.20/debian/vim-tlib.yaml vim-tlib-1.23/debian/vim-tlib.yaml --- vim-tlib-1.20/debian/vim-tlib.yaml 2016-02-13 13:23:58.000000000 +0000 +++ vim-tlib-1.23/debian/vim-tlib.yaml 2018-01-08 14:34:09.000000000 +0000 @@ -6,6 +6,7 @@ - test/tlib.vim - spec/tlib/arg.vim - spec/tlib/date.vim + - spec/tlib/dictionary.vim - spec/tlib/eval.vim - spec/tlib/file.vim - spec/tlib/hash.vim diff -Nru vim-tlib-1.20/doc/tlib.txt vim-tlib-1.23/doc/tlib.txt --- vim-tlib-1.20/doc/tlib.txt 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/doc/tlib.txt 2017-03-16 19:32:34.000000000 +0000 @@ -30,403 +30,184 @@ ======================================================================== Contents~ - :TLet .................................. |:TLet| - :TScratch .............................. |:TScratch| - :TVarArg ............................... |:TVarArg| - :TBrowseOutput ......................... |:TBrowseOutput| - :TBrowseScriptnames .................... |:TBrowseScriptnames| - :Tlibtrace ............................. |:Tlibtrace| - :Tlibtraceset .......................... |:Tlibtraceset| - :Tlibassert ............................ |:Tlibassert| - :Tlibtype .............................. |:Tlibtype| - Add .................................... |Add()| - TestGetArg ............................. |TestGetArg()| - TestGetArg1 ............................ |TestGetArg1()| - TestArgs ............................... |TestArgs()| - TestArgs1 .............................. |TestArgs1()| - TestArgs2 .............................. |TestArgs2()| - TestArgs3 .............................. |TestArgs3()| - g:tlib#debug ........................... |g:tlib#debug| - tlib#notify#Echo ....................... |tlib#notify#Echo()| - tlib#notify#TrimMessage ................ |tlib#notify#TrimMessage()| - g:tlib#trace#backtrace ................. |g:tlib#trace#backtrace| - g:tlib#trace#printf .................... |g:tlib#trace#printf| - tlib#trace#PrintToFile ................. |tlib#trace#PrintToFile()| - tlib#trace#Set ......................... |tlib#trace#Set()| - tlib#trace#Backtrace ................... |tlib#trace#Backtrace()| - tlib#trace#Print ....................... |tlib#trace#Print()| - tlib#trace#Enable ...................... |tlib#trace#Enable()| - tlib#trace#Disable ..................... |tlib#trace#Disable()| - tlib#dictionary#Rev .................... |tlib#dictionary#Rev()| - g:tlib_persistent ...................... |g:tlib_persistent| - tlib#persistent#Dir .................... |tlib#persistent#Dir()| - tlib#persistent#Filename ............... |tlib#persistent#Filename()| - tlib#persistent#Get .................... |tlib#persistent#Get()| - tlib#persistent#MTime .................. |tlib#persistent#MTime()| - tlib#persistent#Value .................. |tlib#persistent#Value()| - tlib#persistent#Save ................... |tlib#persistent#Save()| - g:tlib#vim#simalt_maximize ............. |g:tlib#vim#simalt_maximize| - g:tlib#vim#simalt_restore .............. |g:tlib#vim#simalt_restore| - g:tlib#vim#use_vimtweak ................ |g:tlib#vim#use_vimtweak| - tlib#vim#Maximize ...................... |tlib#vim#Maximize()| - tlib#vim#RestoreWindow ................. |tlib#vim#RestoreWindow()| - g:tlib#vim#use_wmctrl .................. |g:tlib#vim#use_wmctrl| - tlib#vim#CopyFunction .................. |tlib#vim#CopyFunction()| - tlib#progressbar#Init .................. |tlib#progressbar#Init()| - tlib#progressbar#Display ............... |tlib#progressbar#Display()| - tlib#progressbar#Restore ............... |tlib#progressbar#Restore()| - tlib#selection#GetSelection ............ |tlib#selection#GetSelection()| - tlib#eval#FormatValue .................. |tlib#eval#FormatValue()| - tlib#eval#Extend ....................... |tlib#eval#Extend()| - tlib#list#Inject ....................... |tlib#list#Inject()| - tlib#list#Compact ...................... |tlib#list#Compact()| - tlib#list#Flatten ...................... |tlib#list#Flatten()| - tlib#list#FindAll ...................... |tlib#list#FindAll()| - tlib#list#Find ......................... |tlib#list#Find()| - tlib#list#Any .......................... |tlib#list#Any()| - tlib#list#All .......................... |tlib#list#All()| - tlib#list#Remove ....................... |tlib#list#Remove()| - tlib#list#RemoveAll .................... |tlib#list#RemoveAll()| - tlib#list#Zip .......................... |tlib#list#Zip()| - tlib#list#Uniq ......................... |tlib#list#Uniq()| - tlib#list#ToDictionary ................. |tlib#list#ToDictionary()| - tlib#cmd#OutputAsList .................. |tlib#cmd#OutputAsList()| - tlib#cmd#BrowseOutput .................. |tlib#cmd#BrowseOutput()| - tlib#cmd#BrowseOutputWithCallback ...... |tlib#cmd#BrowseOutputWithCallback()| - tlib#cmd#DefaultBrowseOutput ........... |tlib#cmd#DefaultBrowseOutput()| - tlib#cmd#ParseScriptname ............... |tlib#cmd#ParseScriptname()| - tlib#cmd#TBrowseScriptnames ............ |tlib#cmd#TBrowseScriptnames()| - tlib#cmd#UseVertical ................... |tlib#cmd#UseVertical()| - tlib#cmd#Time .......................... |tlib#cmd#Time()| - tlib#cmd#Capture ....................... |tlib#cmd#Capture()| - tlib#syntax#Collect .................... |tlib#syntax#Collect()| - tlib#syntax#Names ...................... |tlib#syntax#Names()| - tlib#balloon#Register .................. |tlib#balloon#Register()| - tlib#balloon#Remove .................... |tlib#balloon#Remove()| - tlib#balloon#Expr ...................... |tlib#balloon#Expr()| - tlib#balloon#Expand .................... |tlib#balloon#Expand()| - g:tlib#vcs#def ......................... |g:tlib#vcs#def| - g:tlib#vcs#executables ................. |g:tlib#vcs#executables| - g:tlib#vcs#check ....................... |g:tlib#vcs#check| - tlib#vcs#Executable .................... |tlib#vcs#Executable()| - tlib#vcs#FindVCS ....................... |tlib#vcs#FindVCS()| - tlib#vcs#Ls ............................ |tlib#vcs#Ls()| - tlib#vcs#Diff .......................... |tlib#vcs#Diff()| - tlib#vcs#GitLsPostprocess .............. |tlib#vcs#GitLsPostprocess()| - tlib#char#Get .......................... |tlib#char#Get()| - tlib#char#IsAvailable .................. |tlib#char#IsAvailable()| - tlib#char#GetWithTimeout ............... |tlib#char#GetWithTimeout()| - g:tlib#Filter_glob#seq ................. |g:tlib#Filter_glob#seq| - g:tlib#Filter_glob#char ................ |g:tlib#Filter_glob#char| - tlib#Filter_glob#New ................... |tlib#Filter_glob#New()| - g:tlib_scratch_pos ..................... |g:tlib_scratch_pos| - g:tlib#scratch#hidden .................. |g:tlib#scratch#hidden| - tlib#scratch#UseScratch ................ |tlib#scratch#UseScratch()| - tlib#scratch#CloseScratch .............. |tlib#scratch#CloseScratch()| - tlib#autocmdgroup#Init ................. |tlib#autocmdgroup#Init()| - g:tlib_cache ........................... |g:tlib_cache| - g:tlib#cache#purge_days ................ |g:tlib#cache#purge_days| - g:tlib#cache#purge_every_days .......... |g:tlib#cache#purge_every_days| - g:tlib#cache#script_encoding ........... |g:tlib#cache#script_encoding| - g:tlib#cache#run_script ................ |g:tlib#cache#run_script| - g:tlib#cache#verbosity ................. |g:tlib#cache#verbosity| - g:tlib#cache#dont_purge ................ |g:tlib#cache#dont_purge| - g:tlib#cache#max_filename .............. |g:tlib#cache#max_filename| - tlib#cache#Dir ......................... |tlib#cache#Dir()| - tlib#cache#Filename .................... |tlib#cache#Filename()| - tlib#cache#Save ........................ |tlib#cache#Save()| - tlib#cache#MTime ....................... |tlib#cache#MTime()| - tlib#cache#Get ......................... |tlib#cache#Get()| - tlib#cache#Value ....................... |tlib#cache#Value()| - tlib#cache#MaybePurge .................. |tlib#cache#MaybePurge()| - tlib#cache#Purge ....................... |tlib#cache#Purge()| - tlib#cache#ListFilesInCache ............ |tlib#cache#ListFilesInCache()| - tlib#normal#WithRegister ............... |tlib#normal#WithRegister()| - tlib#time#MSecs ........................ |tlib#time#MSecs()| - tlib#time#Now .......................... |tlib#time#Now()| - tlib#time#FormatNow .................... |tlib#time#FormatNow()| - tlib#time#Diff ......................... |tlib#time#Diff()| - tlib#time#DiffMSecs .................... |tlib#time#DiffMSecs()| - tlib#var#Let ........................... |tlib#var#Let()| - tlib#var#EGet .......................... |tlib#var#EGet()| - tlib#var#Get ........................... |tlib#var#Get()| - tlib#var#List .......................... |tlib#var#List()| - g:tlib_scroll_lines .................... |g:tlib_scroll_lines| - tlib#agent#Exit ........................ |tlib#agent#Exit()| - tlib#agent#CopyItems ................... |tlib#agent#CopyItems()| - tlib#agent#PageUp ...................... |tlib#agent#PageUp()| - tlib#agent#PageDown .................... |tlib#agent#PageDown()| - tlib#agent#Home ........................ |tlib#agent#Home()| - tlib#agent#End ......................... |tlib#agent#End()| - tlib#agent#Up .......................... |tlib#agent#Up()| - tlib#agent#Down ........................ |tlib#agent#Down()| - tlib#agent#UpN ......................... |tlib#agent#UpN()| - tlib#agent#DownN ....................... |tlib#agent#DownN()| - tlib#agent#ShiftLeft ................... |tlib#agent#ShiftLeft()| - tlib#agent#ShiftRight .................. |tlib#agent#ShiftRight()| - tlib#agent#Reset ....................... |tlib#agent#Reset()| - tlib#agent#ToggleRestrictView .......... |tlib#agent#ToggleRestrictView()| - tlib#agent#RestrictView ................ |tlib#agent#RestrictView()| - tlib#agent#UnrestrictView .............. |tlib#agent#UnrestrictView()| - tlib#agent#Input ....................... |tlib#agent#Input()| - tlib#agent#SuspendToParentWindow ....... |tlib#agent#SuspendToParentWindow()| - tlib#agent#Suspend ..................... |tlib#agent#Suspend()| - tlib#agent#Help ........................ |tlib#agent#Help()| - tlib#agent#OR .......................... |tlib#agent#OR()| - tlib#agent#AND ......................... |tlib#agent#AND()| - tlib#agent#ReduceFilter ................ |tlib#agent#ReduceFilter()| - tlib#agent#PopFilter ................... |tlib#agent#PopFilter()| - tlib#agent#Debug ....................... |tlib#agent#Debug()| - tlib#agent#Select ...................... |tlib#agent#Select()| - tlib#agent#SelectUp .................... |tlib#agent#SelectUp()| - tlib#agent#SelectDown .................. |tlib#agent#SelectDown()| - tlib#agent#SelectAll ................... |tlib#agent#SelectAll()| - tlib#agent#ToggleStickyList ............ |tlib#agent#ToggleStickyList()| - tlib#agent#EditItem .................... |tlib#agent#EditItem()| - tlib#agent#NewItem ..................... |tlib#agent#NewItem()| - tlib#agent#DeleteItems ................. |tlib#agent#DeleteItems()| - tlib#agent#Cut ......................... |tlib#agent#Cut()| - tlib#agent#Copy ........................ |tlib#agent#Copy()| - tlib#agent#Paste ....................... |tlib#agent#Paste()| - tlib#agent#EditReturnValue ............. |tlib#agent#EditReturnValue()| - tlib#agent#ViewFile .................... |tlib#agent#ViewFile()| - tlib#agent#EditFile .................... |tlib#agent#EditFile()| - tlib#agent#EditFileInSplit ............. |tlib#agent#EditFileInSplit()| - tlib#agent#EditFileInVSplit ............ |tlib#agent#EditFileInVSplit()| - tlib#agent#EditFileInTab ............... |tlib#agent#EditFileInTab()| - tlib#agent#ToggleScrollbind ............ |tlib#agent#ToggleScrollbind()| - tlib#agent#ShowInfo .................... |tlib#agent#ShowInfo()| - tlib#agent#PreviewLine ................. |tlib#agent#PreviewLine()| - tlib#agent#GotoLine .................... |tlib#agent#GotoLine()| - tlib#agent#DoAtLine .................... |tlib#agent#DoAtLine()| - tlib#agent#Wildcard .................... |tlib#agent#Wildcard()| - tlib#agent#Null ........................ |tlib#agent#Null()| - tlib#agent#ExecAgentByName ............. |tlib#agent#ExecAgentByName()| - tlib#agent#CompleteAgentNames .......... |tlib#agent#CompleteAgentNames()| - tlib#agent#Complete .................... |tlib#agent#Complete()| - tlib#bitwise#Num2Bits .................. |tlib#bitwise#Num2Bits()| - tlib#bitwise#Bits2Num .................. |tlib#bitwise#Bits2Num()| - tlib#bitwise#AND ....................... |tlib#bitwise#AND()| - tlib#bitwise#OR ........................ |tlib#bitwise#OR()| - tlib#bitwise#XOR ....................... |tlib#bitwise#XOR()| - tlib#bitwise#ShiftRight ................ |tlib#bitwise#ShiftRight()| - tlib#bitwise#ShiftLeft ................. |tlib#bitwise#ShiftLeft()| - tlib#bitwise#Add ....................... |tlib#bitwise#Add()| - tlib#bitwise#Sub ....................... |tlib#bitwise#Sub()| - tlib#url#Decode ........................ |tlib#url#Decode()| - tlib#url#DecodeChar .................... |tlib#url#DecodeChar()| - tlib#url#EncodeChar .................... |tlib#url#EncodeChar()| - tlib#url#Encode ........................ |tlib#url#Encode()| - tlib#signs#ClearAll .................... |tlib#signs#ClearAll()| - tlib#signs#ClearBuffer ................. |tlib#signs#ClearBuffer()| - tlib#signs#Mark ........................ |tlib#signs#Mark()| - tlib#rx#Escape ......................... |tlib#rx#Escape()| - tlib#rx#EscapeReplace .................. |tlib#rx#EscapeReplace()| - tlib#rx#Suffixes ....................... |tlib#rx#Suffixes()| - tlib#rx#LooksLikeRegexp ................ |tlib#rx#LooksLikeRegexp()| - g:tlib_tags_extra ...................... |g:tlib_tags_extra| - g:tlib_tag_substitute .................. |g:tlib_tag_substitute| - tlib#tag#Retrieve ...................... |tlib#tag#Retrieve()| - tlib#tag#Collect ....................... |tlib#tag#Collect()| - tlib#tag#Format ........................ |tlib#tag#Format()| - tlib#map#PumAccept ..................... |tlib#map#PumAccept()| - tlib#Filter_cnfd#New ................... |tlib#Filter_cnfd#New()| - g:tlib#input#sortprefs_threshold ....... |g:tlib#input#sortprefs_threshold| - g:tlib#input#livesearch_threshold ...... |g:tlib#input#livesearch_threshold| - g:tlib#input#filter_mode ............... |g:tlib#input#filter_mode| - g:tlib#input#higroup ................... |g:tlib#input#higroup| - g:tlib_pick_last_item .................. |g:tlib_pick_last_item| - g:tlib#input#and ....................... |g:tlib#input#and| - g:tlib#input#or ........................ |g:tlib#input#or| - g:tlib#input#not ....................... |g:tlib#input#not| - g:tlib#input#numeric_chars ............. |g:tlib#input#numeric_chars| - g:tlib#input#keyagents_InputList_s ..... |g:tlib#input#keyagents_InputList_s| - g:tlib#input#keyagents_InputList_m ..... |g:tlib#input#keyagents_InputList_m| - g:tlib#input#handlers_EditList ......... |g:tlib#input#handlers_EditList| - g:tlib#input#user_shortcuts ............ |g:tlib#input#user_shortcuts| - g:tlib#input#use_popup ................. |g:tlib#input#use_popup| - g:tlib#input#format_filename ........... |g:tlib#input#format_filename| - g:tlib#input#filename_padding_r ........ |g:tlib#input#filename_padding_r| - g:tlib#input#filename_max_width ........ |g:tlib#input#filename_max_width| - tlib#input#List ........................ |tlib#input#List()| - tlib#input#ListD ....................... |tlib#input#ListD()| - tlib#input#ListW ....................... |tlib#input#ListW()| - tlib#input#EditList .................... |tlib#input#EditList()| - tlib#input#Resume ...................... |tlib#input#Resume()| - tlib#input#CommandSelect ............... |tlib#input#CommandSelect()| - tlib#input#Edit ........................ |tlib#input#Edit()| - tlib#input#Dialog ...................... |tlib#input#Dialog()| - tlib#number#ConvertBase ................ |tlib#number#ConvertBase()| - g:tlib#file#drop ....................... |g:tlib#file#drop| - g:tlib#file#use_tabs ................... |g:tlib#file#use_tabs| - g:tlib#file#edit_cmds .................. |g:tlib#file#edit_cmds| - g:tlib#file#absolute_filename_rx ....... |g:tlib#file#absolute_filename_rx| - tlib#file#Split ........................ |tlib#file#Split()| - tlib#file#Join ......................... |tlib#file#Join()| - tlib#file#Relative ..................... |tlib#file#Relative()| - tlib#file#Absolute ..................... |tlib#file#Absolute()| - tlib#file#Canonic ...................... |tlib#file#Canonic()| - tlib#file#With ......................... |tlib#file#With()| - tlib#file#Edit ......................... |tlib#file#Edit()| - tlib#file#Glob ......................... |tlib#file#Glob()| - tlib#file#Globpath ..................... |tlib#file#Globpath()| - g:tlib#sys#special_protocols ........... |g:tlib#sys#special_protocols| - g:tlib#sys#special_suffixes ............ |g:tlib#sys#special_suffixes| - g:tlib#sys#system_rx ................... |g:tlib#sys#system_rx| - g:tlib#sys#system_browser .............. |g:tlib#sys#system_browser| - g:tlib#sys#windows ..................... |g:tlib#sys#windows| - g:tlib#sys#null ........................ |g:tlib#sys#null| - tlib#sys#IsCygwinBin ................... |tlib#sys#IsCygwinBin()| - tlib#sys#IsExecutable .................. |tlib#sys#IsExecutable()| - g:tlib#sys#check_cygpath ............... |g:tlib#sys#check_cygpath| - g:tlib#sys#cygwin_path_rx .............. |g:tlib#sys#cygwin_path_rx| - g:tlib#sys#cygwin_expr ................. |g:tlib#sys#cygwin_expr| - tlib#sys#GetCmd ........................ |tlib#sys#GetCmd()| - tlib#sys#MaybeUseCygpath ............... |tlib#sys#MaybeUseCygpath()| - tlib#sys#ConvertPath ................... |tlib#sys#ConvertPath()| - tlib#sys#FileArgs ...................... |tlib#sys#FileArgs()| - tlib#sys#IsSpecial ..................... |tlib#sys#IsSpecial()| - tlib#sys#Open .......................... |tlib#sys#Open()| - tlib#sys#SystemInDir ................... |tlib#sys#SystemInDir()| - tlib#paragraph#GetMetric ............... |tlib#paragraph#GetMetric()| - tlib#paragraph#Move .................... |tlib#paragraph#Move()| - g:tlib_inputlist_pct ................... |g:tlib_inputlist_pct| - g:tlib_inputlist_width_filename ........ |g:tlib_inputlist_width_filename| - g:tlib_inputlist_filename_indicators ... |g:tlib_inputlist_filename_indicators| - g:tlib_inputlist_shortmessage .......... |g:tlib_inputlist_shortmessage| - tlib#World#New ......................... |tlib#World#New()| - prototype.PrintLines - prototype.Suspend - tlib#loclist#Browse .................... |tlib#loclist#Browse()| - tlib#tab#BufMap ........................ |tlib#tab#BufMap()| - tlib#tab#TabWinNr ...................... |tlib#tab#TabWinNr()| - tlib#tab#Set ........................... |tlib#tab#Set()| - tlib#date#IsDate ....................... |tlib#date#IsDate()| - tlib#date#Format ....................... |tlib#date#Format()| - tlib#date#DiffInDays ................... |tlib#date#DiffInDays()| - tlib#date#Parse ........................ |tlib#date#Parse()| - tlib#date#SecondsSince1970 ............. |tlib#date#SecondsSince1970()| - tlib#date#Shift ........................ |tlib#date#Shift()| - tlib#type#Enable ....................... |tlib#type#Enable()| - tlib#type#Disable ...................... |tlib#type#Disable()| - tlib#type#IsNumber ..................... |tlib#type#IsNumber()| - tlib#type#IsString ..................... |tlib#type#IsString()| - tlib#type#IsFuncref .................... |tlib#type#IsFuncref()| - tlib#type#IsList ....................... |tlib#type#IsList()| - tlib#type#IsDictionary ................. |tlib#type#IsDictionary()| - tlib#type#Is ........................... |tlib#type#Is()| - tlib#type#Are .......................... |tlib#type#Are()| - tlib#type#Define ....................... |tlib#type#Define()| - tlib#type#Has .......................... |tlib#type#Has()| - tlib#type#Have ......................... |tlib#type#Have()| - tlib#type#Check ........................ |tlib#type#Check()| - tlib#Filter_fuzzy#New .................. |tlib#Filter_fuzzy#New()| - tlib#assert#Enable ..................... |tlib#assert#Enable()| - tlib#assert#Disable .................... |tlib#assert#Disable()| - tlib#assert#Assert ..................... |tlib#assert#Assert()| - tlib#assert#Map ........................ |tlib#assert#Map()| - tlib#assert#All ........................ |tlib#assert#All()| - tlib#textobjects#StandardParagraph ..... |standard-paragraph| - tlib#textobjects#Init .................. |tlib#textobjects#Init()| - v_sp ................................... |v_sp| - o_sp ................................... |o_sp| - tlib#arg#Get ........................... |tlib#arg#Get()| - tlib#arg#Let ........................... |tlib#arg#Let()| - tlib#arg#StringAsKeyArgs ............... |tlib#arg#StringAsKeyArgs()| - tlib#arg#StringAsKeyArgsEqual .......... |tlib#arg#StringAsKeyArgsEqual()| - tlib#arg#GetOpts ....................... |tlib#arg#GetOpts()| - tlib#arg#Ex ............................ |tlib#arg#Ex()| - tlib#fixes#Winpos ...................... |tlib#fixes#Winpos()| - g:tlib#dir#sep ......................... |g:tlib#dir#sep| - tlib#dir#CanonicName ................... |tlib#dir#CanonicName()| - tlib#dir#NativeName .................... |tlib#dir#NativeName()| - tlib#dir#PlainName ..................... |tlib#dir#PlainName()| - tlib#dir#Ensure ........................ |tlib#dir#Ensure()| - tlib#dir#MyRuntime ..................... |tlib#dir#MyRuntime()| - tlib#dir#CD ............................ |tlib#dir#CD()| - tlib#dir#Push .......................... |tlib#dir#Push()| - tlib#dir#Pop ........................... |tlib#dir#Pop()| - g:tlib#hash#use_crc32 .................. |g:tlib#hash#use_crc32| - g:tlib#hash#use_adler32 ................ |g:tlib#hash#use_adler32| - tlib#hash#CRC32B ....................... |tlib#hash#CRC32B()| - tlib#hash#CRC32B_ruby .................. |tlib#hash#CRC32B_ruby()| - tlib#hash#CRC32B_vim ................... |tlib#hash#CRC32B_vim()| - tlib#hash#Adler32 ...................... |tlib#hash#Adler32()| - tlib#hash#Adler32_vim .................. |tlib#hash#Adler32_vim()| - tlib#hash#Adler32_tlib ................. |tlib#hash#Adler32_tlib()| - tlib#win#Set ........................... |tlib#win#Set()| - tlib#win#GetLayout ..................... |tlib#win#GetLayout()| - tlib#win#SetLayout ..................... |tlib#win#SetLayout()| - tlib#win#List .......................... |tlib#win#List()| - tlib#win#Width ......................... |tlib#win#Width()| - tlib#win#WinDo ......................... |tlib#win#WinDo()| - tlib#comments#Comments ................. |tlib#comments#Comments()| - tlib#grep#Do ........................... |tlib#grep#Do()| - tlib#grep#LocList ...................... |tlib#grep#LocList()| - tlib#grep#QuickFixList ................. |tlib#grep#QuickFixList()| - tlib#grep#List ......................... |tlib#grep#List()| - tlib#qfl#FormatQFLE .................... |tlib#qfl#FormatQFLE()| - tlib#qfl#QfeFilename ................... |tlib#qfl#QfeFilename()| - tlib#qfl#InitListBuffer ................ |tlib#qfl#InitListBuffer()| - tlib#qfl#SetSyntax ..................... |tlib#qfl#SetSyntax()| - tlib#qfl#Balloon ....................... |tlib#qfl#Balloon()| - tlib#qfl#AgentEditQFE .................. |tlib#qfl#AgentEditQFE()| - tlib#qfl#AgentPreviewQFE ............... |tlib#qfl#AgentPreviewQFE()| - tlib#qfl#AgentGotoQFE .................. |tlib#qfl#AgentGotoQFE()| - tlib#qfl#AgentWithSelected ............. |tlib#qfl#AgentWithSelected()| - tlib#qfl#RunCmdOnSelected .............. |tlib#qfl#RunCmdOnSelected()| - tlib#qfl#AgentSplitBuffer .............. |tlib#qfl#AgentSplitBuffer()| - tlib#qfl#AgentTabBuffer ................ |tlib#qfl#AgentTabBuffer()| - tlib#qfl#AgentVSplitBuffer ............. |tlib#qfl#AgentVSplitBuffer()| - tlib#qfl#AgentEditLine ................. |tlib#qfl#AgentEditLine()| - tlib#qfl#EditLine ...................... |tlib#qfl#EditLine()| - tlib#qfl#SetFollowCursor ............... |tlib#qfl#SetFollowCursor()| - tlib#qfl#QflList ....................... |tlib#qfl#QflList()| - tlib#qfl#Browse ........................ |tlib#qfl#Browse()| - tlib#Filter_cnf#New .................... |tlib#Filter_cnf#New()| - prototype.Pretty - tlib#Object#New ........................ |tlib#Object#New()| - prototype.New - prototype.Inherit - prototype.Extend - prototype.IsA - prototype.IsRelated - prototype.RespondTo - prototype.Super - tlib#Object#Methods .................... |tlib#Object#Methods()| - g:tlib_viewline_position ............... |g:tlib_viewline_position| - tlib#buffer#EnableMRU .................. |tlib#buffer#EnableMRU()| - tlib#buffer#DisableMRU ................. |tlib#buffer#DisableMRU()| - tlib#buffer#Set ........................ |tlib#buffer#Set()| - tlib#buffer#Eval ....................... |tlib#buffer#Eval()| - tlib#buffer#GetList .................... |tlib#buffer#GetList()| - tlib#buffer#ViewLine ................... |tlib#buffer#ViewLine()| - tlib#buffer#HighlightLine .............. |tlib#buffer#HighlightLine()| - tlib#buffer#DeleteRange ................ |tlib#buffer#DeleteRange()| - tlib#buffer#ReplaceRange ............... |tlib#buffer#ReplaceRange()| - tlib#buffer#ScratchStart ............... |tlib#buffer#ScratchStart()| - tlib#buffer#ScratchEnd ................. |tlib#buffer#ScratchEnd()| - tlib#buffer#BufDo ...................... |tlib#buffer#BufDo()| - tlib#buffer#InsertText ................. |tlib#buffer#InsertText()| - tlib#buffer#InsertText0 ................ |tlib#buffer#InsertText0()| - tlib#buffer#CurrentByte ................ |tlib#buffer#CurrentByte()| - tlib#buffer#KeepCursorPosition ......... |tlib#buffer#KeepCursorPosition()| - tlib#hook#Run .......................... |tlib#hook#Run()| - tlib#string#RemoveBackslashes .......... |tlib#string#RemoveBackslashes()| - tlib#string#Chomp ...................... |tlib#string#Chomp()| - tlib#string#Format ..................... |tlib#string#Format()| - tlib#string#Printf1 .................... |tlib#string#Printf1()| - tlib#string#TrimLeft ................... |tlib#string#TrimLeft()| - tlib#string#TrimRight .................. |tlib#string#TrimRight()| - tlib#string#Strip ...................... |tlib#string#Strip()| - tlib#string#Count ...................... |tlib#string#Count()| - tlib#string#SplitCommaList ............. |tlib#string#SplitCommaList()| - tlib#string#Input ...................... |tlib#string#Input()| + :TLet ................................... |:TLet| + :TScratch ............................... |:TScratch| + :TVarArg ................................ |:TVarArg| + :TBrowseOutput .......................... |:TBrowseOutput| + :TBrowseScriptnames ..................... |:TBrowseScriptnames| + :Tlibtrace .............................. |:Tlibtrace| + :Tlibtraceset ........................... |:Tlibtraceset| + tlib#Filter_cnf#New ..................... |tlib#Filter_cnf#New()| + tlib#Filter_cnfd#New .................... |tlib#Filter_cnfd#New()| + tlib#Filter_fuzzy#New ................... |tlib#Filter_fuzzy#New()| + g:tlib#Filter_glob#seq .................. |g:tlib#Filter_glob#seq| + g:tlib#Filter_glob#char ................. |g:tlib#Filter_glob#char| + tlib#Filter_glob#New .................... |tlib#Filter_glob#New()| + tlib#Object#New ......................... |tlib#Object#New()| + g:tlib_inputlist_pct .................... |g:tlib_inputlist_pct| + g:tlib_inputlist_max_lines .............. |g:tlib_inputlist_max_lines| + g:tlib_inputlist_max_cols ............... |g:tlib_inputlist_max_cols| + g:tlib_inputlist_width_filename ......... |g:tlib_inputlist_width_filename| + g:tlib_inputlist_filename_indicators .... |g:tlib_inputlist_filename_indicators| + g:tlib_inputlist_shortmessage ........... |g:tlib_inputlist_shortmessage| + g:tlib_scroll_lines ..................... |g:tlib_scroll_lines| + tlib#agent#SuspendToParentWindow ........ |tlib#agent#SuspendToParentWindow()| + tlib#agent#Suspend ...................... |tlib#agent#Suspend()| + tlib#agent#NewItem ...................... |tlib#agent#NewItem()| + tlib#agent#GotoLine ..................... |tlib#agent#GotoLine()| + tlib#arg#Get ............................ |tlib#arg#Get()| + tlib#arg#Let ............................ |tlib#arg#Let()| + tlib#arg#GetOpts ........................ |tlib#arg#GetOpts()| + tlib#arg#Ex ............................. |tlib#arg#Ex()| + tlib#assert#Enable ...................... |tlib#assert#Enable()| + tlib#assert#Disable ..................... |tlib#assert#Disable()| + g:tlib_viewline_position ................ |g:tlib_viewline_position| + tlib#buffer#Set ......................... |tlib#buffer#Set()| + tlib#buffer#Eval ........................ |tlib#buffer#Eval()| + tlib#buffer#GetList ..................... |tlib#buffer#GetList()| + tlib#buffer#ViewLine .................... |tlib#buffer#ViewLine()| + tlib#buffer#DeleteRange ................. |tlib#buffer#DeleteRange()| + tlib#buffer#ReplaceRange ................ |tlib#buffer#ReplaceRange()| + tlib#buffer#ScratchStart ................ |tlib#buffer#ScratchStart()| + tlib#buffer#ScratchEnd .................. |tlib#buffer#ScratchEnd()| + tlib#buffer#BufDo ....................... |tlib#buffer#BufDo()| + tlib#buffer#InsertText .................. |tlib#buffer#InsertText()| + tlib#buffer#KeepCursorPosition .......... |tlib#buffer#KeepCursorPosition()| + g:tlib_cache ............................ |g:tlib_cache| + g:tlib#cache#purge_days ................. |g:tlib#cache#purge_days| + g:tlib#cache#purge_every_days ........... |g:tlib#cache#purge_every_days| + g:tlib#cache#script_encoding ............ |g:tlib#cache#script_encoding| + g:tlib#cache#run_script ................. |g:tlib#cache#run_script| + g:tlib#cache#verbosity .................. |g:tlib#cache#verbosity| + g:tlib#cache#dont_purge ................. |g:tlib#cache#dont_purge| + g:tlib#cache#max_filename ............... |g:tlib#cache#max_filename| + tlib#cache#Dir .......................... |tlib#cache#Dir()| + tlib#cache#EncodedFilename .............. |tlib#cache#EncodedFilename()| + tlib#cache#Value ........................ |tlib#cache#Value()| + tlib#cache#MaybePurge ................... |tlib#cache#MaybePurge()| + tlib#cache#Purge ........................ |tlib#cache#Purge()| + tlib#char#Get ........................... |tlib#char#Get()| + tlib#cmd#BrowseOutput ................... |tlib#cmd#BrowseOutput()| + tlib#cmd#BrowseOutputWithCallback ....... |tlib#cmd#BrowseOutputWithCallback()| + tlib#cmd#UseVertical .................... |tlib#cmd#UseVertical()| + tlib#cmd#Time ........................... |tlib#cmd#Time()| + tlib#comments#Comments .................. |tlib#comments#Comments()| + tlib#date#SecondsSince1970 .............. |tlib#date#SecondsSince1970()| + g:tlib#dir#sep .......................... |g:tlib#dir#sep| + tlib#dir#CanonicName .................... |tlib#dir#CanonicName()| + tlib#dir#NativeName ..................... |tlib#dir#NativeName()| + tlib#dir#PlainName ...................... |tlib#dir#PlainName()| + tlib#dir#Ensure ......................... |tlib#dir#Ensure()| + tlib#dir#MyRuntime ...................... |tlib#dir#MyRuntime()| + g:tlib#file#drop ........................ |g:tlib#file#drop| + tlib#file#Split ......................... |tlib#file#Split()| + tlib#file#Join .......................... |tlib#file#Join()| + tlib#file#Relative ...................... |tlib#file#Relative()| + tlib#file#Edit .......................... |tlib#file#Edit()| + tlib#hook#Run ........................... |tlib#hook#Run()| + g:tlib#input#sortprefs_threshold ........ |g:tlib#input#sortprefs_threshold| + g:tlib#input#livesearch_threshold ....... |g:tlib#input#livesearch_threshold| + g:tlib#input#filter_mode ................ |g:tlib#input#filter_mode| + g:tlib#input#higroup .................... |g:tlib#input#higroup| + g:tlib_pick_last_item ................... |g:tlib_pick_last_item| + g:tlib#input#numeric_chars .............. |g:tlib#input#numeric_chars| + g:tlib#input#keyagents_InputList_s ...... |g:tlib#input#keyagents_InputList_s| + g:tlib#input#user_shortcuts ............. |g:tlib#input#user_shortcuts| + g:tlib#input#use_popup .................. |g:tlib#input#use_popup| + g:tlib#input#format_filename ............ |g:tlib#input#format_filename| + g:tlib#input#filename_padding_r ......... |g:tlib#input#filename_padding_r| + g:tlib#input#filename_max_width ......... |g:tlib#input#filename_max_width| + tlib#input#List ......................... |tlib#input#List()| + tlib#input#ListD ........................ |tlib#input#ListD()| + tlib#input#ListW ........................ |tlib#input#ListW()| + tlib#input#EditList ..................... |tlib#input#EditList()| + tlib#input#CommandSelect ................ |tlib#input#CommandSelect()| + tlib#input#Edit ......................... |tlib#input#Edit()| + tlib#list#Inject ........................ |tlib#list#Inject()| + tlib#list#Compact ....................... |tlib#list#Compact()| + tlib#list#Flatten ....................... |tlib#list#Flatten()| + tlib#list#FindAll ....................... |tlib#list#FindAll()| + tlib#list#Find .......................... |tlib#list#Find()| + tlib#list#Any ........................... |tlib#list#Any()| + tlib#list#All ........................... |tlib#list#All()| + tlib#list#Remove ........................ |tlib#list#Remove()| + tlib#list#RemoveAll ..................... |tlib#list#RemoveAll()| + tlib#list#Zip ........................... |tlib#list#Zip()| + tlib#map#PumAccept ...................... |tlib#map#PumAccept()| + tlib#normal#WithRegister ................ |tlib#normal#WithRegister()| + tlib#notify#Echo ........................ |tlib#notify#Echo()| + tlib#notify#TrimMessage ................. |tlib#notify#TrimMessage()| + tlib#paragraph#GetMetric ................ |tlib#paragraph#GetMetric()| + tlib#paragraph#Move ..................... |tlib#paragraph#Move()| + g:tlib_persistent ....................... |g:tlib_persistent| + tlib#persistent#Dir ..................... |tlib#persistent#Dir()| + tlib#progressbar#Init ................... |tlib#progressbar#Init()| + tlib#rx#Escape .......................... |tlib#rx#Escape()| + tlib#rx#EscapeReplace ................... |tlib#rx#EscapeReplace()| + g:tlib_scratch_pos ...................... |g:tlib_scratch_pos| + g:tlib#scratch#hidden ................... |g:tlib#scratch#hidden| + tlib#scratch#UseScratch ................. |tlib#scratch#UseScratch()| + tlib#scratch#CloseScratch ............... |tlib#scratch#CloseScratch()| + tlib#selection#GetSelection ............. |tlib#selection#GetSelection()| + tlib#signs#ClearAll ..................... |tlib#signs#ClearAll()| + tlib#signs#ClearBuffer .................. |tlib#signs#ClearBuffer()| + tlib#signs#Mark ......................... |tlib#signs#Mark()| + tlib#string#RemoveBackslashes ........... |tlib#string#RemoveBackslashes()| + tlib#string#Format ...................... |tlib#string#Format()| + tlib#string#Printf1 ..................... |tlib#string#Printf1()| + g:tlib#sys#special_protocols ............ |g:tlib#sys#special_protocols| + g:tlib#sys#special_suffixes ............. |g:tlib#sys#special_suffixes| + g:tlib#sys#system_rx .................... |g:tlib#sys#system_rx| + g:tlib#sys#system_browser ............... |g:tlib#sys#system_browser| + g:tlib#sys#check_cygpath ................ |g:tlib#sys#check_cygpath| + g:tlib#sys#cygwin_path_rx ............... |g:tlib#sys#cygwin_path_rx| + g:tlib#sys#cygwin_expr .................. |g:tlib#sys#cygwin_expr| + tlib#sys#MaybeUseCygpath ................ |tlib#sys#MaybeUseCygpath()| + tlib#sys#IsSpecial ...................... |tlib#sys#IsSpecial()| + tlib#sys#Open ........................... |tlib#sys#Open()| + tlib#sys#OpenWithSystemViewer ........... |tlib#sys#OpenWithSystemViewer()| + tlib#tab#BufMap ......................... |tlib#tab#BufMap()| + tlib#tab#TabWinNr ....................... |tlib#tab#TabWinNr()| + g:tlib_tags_extra ....................... |g:tlib_tags_extra| + g:tlib_tag_substitute ................... |g:tlib_tag_substitute| + tlib#tag#Retrieve ....................... |tlib#tag#Retrieve()| + tlib#tag#Collect ........................ |tlib#tag#Collect()| + tlib#textobjects#StandardParagraph ...... |standard-paragraph| + v_sp .................................... |v_sp| + g:tlib#trace#backtrace .................. |g:tlib#trace#backtrace| + g:tlib#trace#printer .................... |g:tlib#trace#printer| + tlib#trace#Printer_echom ................ |tlib#trace#Printer_echom()| + tlib#trace#Set .......................... |tlib#trace#Set()| + tlib#trace#Print ........................ |tlib#trace#Print()| + tlib#trace#Enable ....................... |tlib#trace#Enable()| + tlib#trace#Disable ...................... |tlib#trace#Disable()| + tlib#type#Enable ........................ |tlib#type#Enable()| + tlib#type#Disable ....................... |tlib#type#Disable()| + tlib#url#Decode ......................... |tlib#url#Decode()| + tlib#url#DecodeChar ..................... |tlib#url#DecodeChar()| + tlib#url#EncodeChar ..................... |tlib#url#EncodeChar()| + tlib#url#Encode ......................... |tlib#url#Encode()| + tlib#var#Let ............................ |tlib#var#Let()| + tlib#var#EGet ........................... |tlib#var#EGet()| + tlib#var#Get ............................ |tlib#var#Get()| + tlib#var#List ........................... |tlib#var#List()| + g:tlib#vcs#def .......................... |g:tlib#vcs#def| + g:tlib#vcs#executables .................. |g:tlib#vcs#executables| + g:tlib#vcs#check ........................ |g:tlib#vcs#check| + tlib#vcs#Ls ............................. |tlib#vcs#Ls()| + tlib#vcs#Diff ........................... |tlib#vcs#Diff()| + g:tlib#vim#simalt_maximize .............. |g:tlib#vim#simalt_maximize| + g:tlib#vim#simalt_restore ............... |g:tlib#vim#simalt_restore| + g:tlib#vim#use_vimtweak ................. |g:tlib#vim#use_vimtweak| + tlib#vim#Maximize ....................... |tlib#vim#Maximize()| + tlib#vim#RestoreWindow .................. |tlib#vim#RestoreWindow()| + g:tlib#vim#use_wmctrl ................... |g:tlib#vim#use_wmctrl| + tlib#win#Set ............................ |tlib#win#Set()| + tlib#win#SetById ........................ |tlib#win#SetById()| -======================================================================== -plugin/02tlib.vim~ - +------------------------------------------------------------------------ + *plugin/02tlib.vim* *:TLet* :TLet VAR = VALUE Set a variable only if it doesn't already exist. @@ -497,323 +278,391 @@ *:Tlibtraceset* :Tlibtraceset - :Tlibtraceset +RX1, -RX2... + :Tlibtraceset[!] [--file=FILE] +RX1 -RX2... If |tlib#trace#Enable()| was called: With the optional , users can add and remove GUARDs (actually a |regexp|) that should be traced. - *:Tlibassert* -:Tlibtrace ASSERTION - - *:Tlibtype* -:Tlibtype val, 'type', ... - + If no `+` or `-` is prepended, assume `+`. -======================================================================== -test/tlib.vim~ + With the optional bang '!', reset any options. - *Add()* -Add(a,b) - List - *TestGetArg()* -TestGetArg(...) - Optional arguments +------------------------------------------------------------------------ + *autoload/tlib/Filter_cnf.vim* + *tlib#Filter_cnf#New()* +tlib#Filter_cnf#New(...) + The search pattern for |tlib#input#List()| is in conjunctive normal + form: (P1 OR P2 ...) AND (P3 OR P4 ...) ... + The pattern is a '/\V' very no-'/magic' regexp pattern. - *TestGetArg1()* -TestGetArg1(...) + Pressing joins two patterns with AND. + Pressing | joins two patterns with OR. + I.e. In order to get "lala AND (foo OR bar)", you type + "lala foo|bar". - *TestArgs()* -TestArgs(...) + This is also the base class for other filters. - *TestArgs1()* -TestArgs1(...) - *TestArgs2()* -TestArgs2(...) +------------------------------------------------------------------------ + *autoload/tlib/Filter_cnfd.vim* + *tlib#Filter_cnfd#New()* +tlib#Filter_cnfd#New(...) + The same as |tlib#Filter_cnf#New()| but a dot is expanded to '\.\{-}'. + As a consequence, patterns cannot match dots. + The pattern is a '/\V' very no-'/magic' regexp pattern. - *TestArgs3()* -TestArgs3(...) +------------------------------------------------------------------------ + *autoload/tlib/Filter_fuzzy.vim* + *tlib#Filter_fuzzy#New()* +tlib#Filter_fuzzy#New(...) + Support for "fuzzy" pattern matching in |tlib#input#List()|. + Patterns are interpreted as if characters were connected with '.\{-}'. -======================================================================== -autoload/tlib.vim~ + In "fuzzy" mode, the pretty printing of filenames is disabled. - *g:tlib#debug* -g:tlib#debug +------------------------------------------------------------------------ + *autoload/tlib/Filter_glob.vim* + *g:tlib#Filter_glob#seq* +g:tlib#Filter_glob#seq (default: '*') + A character that should be expanded to '\.\{-}'. -======================================================================== -autoload/tlib/notify.vim~ + *g:tlib#Filter_glob#char* +g:tlib#Filter_glob#char (default: '?') + A character that should be expanded to '\.\?'. - *tlib#notify#Echo()* -tlib#notify#Echo(text, ?style='') - Print text in the echo area. Temporarily disable 'ruler' and 'showcmd' - in order to prevent |press-enter| messages. + *tlib#Filter_glob#New()* +tlib#Filter_glob#New(...) + The same as |tlib#Filter_cnf#New()| but a a customizable character + |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and + |g:tlib#Filter_glob#char| is expanded to '\.'. + The pattern is a '/\V' very no-'/magic' regexp pattern. - *tlib#notify#TrimMessage()* -tlib#notify#TrimMessage(message) - Contributed by Erik Falor: - If the line containing the message is too long, echoing it will cause - a 'Hit ENTER' prompt to appear. This function cleans up the line so - that does not happen. - The echoed line is too long if it is wider than the width of the - window, minus cmdline space taken up by the ruler and showcmd - features. +------------------------------------------------------------------------ + *autoload/tlib/Object.vim* +Provides a prototype plus some OO-like methods. -======================================================================== -autoload/tlib/trace.vim~ + *tlib#Object#New()* +tlib#Object#New(?fields={}) + This function creates a prototype that provides some kind of + inheritance mechanism and a way to call parent/super methods. - *g:tlib#trace#backtrace* -g:tlib#trace#backtrace (default: 2) - The length of the backtrace that should be included in - |tlib#trace#Print()|. + The usage demonstrated in the following example works best when every + class/prototype is defined in a file of its own. - *g:tlib#trace#printf* -g:tlib#trace#printf (default: 'echom %s') - The command used for printing traces from |tlib#trace#Print()|. - - *tlib#trace#PrintToFile()* -tlib#trace#PrintToFile(filename) - Set |g:tlib#trace#printf| to make |tlib#trace#Print()| print to - `filename`. + The reason for why there is a dedicated constructor function is that + this layout facilitates the use of templates and that methods are + hidden from the user. Other solutions are possible. - *tlib#trace#Set()* -tlib#trace#Set(vars) - Set the tracing |regexp|. See |:Tlibtrace|. - This will also call |tlib#trace#Enable()|. + EXAMPLES: > + let s:prototype = tlib#Object#New({ + \ '_class': ['FooBar'], + \ 'foo': 1, + \ 'bar': 2, + \ }) + " Constructor + function! FooBar(...) + let object = s:prototype.New(a:0 >= 1 ? a:1 : {}) + return object + endf + function! s:prototype.babble() { + echo "I think, therefore I am ". (self.foo * self.bar) ." months old." + } - Examples: - call tlib#trace#Set(["+foo", "-bar"]) - call tlib#trace#Set("+foo,-bar") +< This could now be used like this: > + let myfoo = FooBar({'foo': 3}) + call myfoo.babble() + => I think, therefore I am 6 months old. + echo myfoo.IsA('FooBar') + => 1 + echo myfoo.IsA('object') + => 1 + echo myfoo.IsA('Foo') + => 0 + echo myfoo.RespondTo('babble') + => 1 + echo myfoo.RespondTo('speak') + => 0 +< - *tlib#trace#Backtrace()* -tlib#trace#Backtrace(caller) - *tlib#trace#Print()* -tlib#trace#Print(caller, vars, values) - Print the values of vars. The first value is a "guard" (see - |:Tlibtrace|). +------------------------------------------------------------------------ + *autoload/tlib/World.vim* +A prototype used by |tlib#input#List|. +Inherits from |tlib#Object#New|. - *tlib#trace#Enable()* -tlib#trace#Enable() - Enable tracing via |:Tlibtrace|. + *g:tlib_inputlist_pct* +g:tlib_inputlist_pct (default: 50) + Size of the input list window (in percent) from the main size (of &lines). + See |tlib#input#List()|. - *tlib#trace#Disable()* -tlib#trace#Disable() - Disable tracing via |:Tlibtrace|. + *g:tlib_inputlist_max_lines* +g:tlib_inputlist_max_lines (default: -1) + Max height for a horizontal list. + + *g:tlib_inputlist_max_cols* +g:tlib_inputlist_max_cols (default: -1) + Max width for a vertical list. + *g:tlib_inputlist_width_filename* +g:tlib_inputlist_width_filename (default: '&columns / 3') + Size of filename columns when listing filenames. + See |tlib#input#List()|. -======================================================================== -autoload/tlib/dictionary.vim~ + *g:tlib_inputlist_filename_indicators* +g:tlib_inputlist_filename_indicators (default: 0) + If true, |tlib#input#List()| will show some indicators about the + status of a filename (e.g. buflisted(), bufloaded() etc.). + This is disabled by default because vim checks also for the file on + disk when doing this. - *tlib#dictionary#Rev()* -tlib#dictionary#Rev(dict) + *g:tlib_inputlist_shortmessage* +g:tlib_inputlist_shortmessage (default: 0) + If not null, display only a short info about the filter. -======================================================================== -autoload/tlib/persistent.vim~ +------------------------------------------------------------------------ + *autoload/tlib/agent.vim* +Various agents for use as key handlers in tlib#input#List() - *g:tlib_persistent* -g:tlib_persistent (default: '') - The directory for persistent data files. If empty, use - |tlib#dir#MyRuntime|.'/share'. + *g:tlib_scroll_lines* +g:tlib_scroll_lines (default: 10) + Number of items to move when pressing in the input list window. - *tlib#persistent#Dir()* -tlib#persistent#Dir(?mode = 'bg') - Return the full directory name for persistent data files. + *tlib#agent#SuspendToParentWindow()* +tlib#agent#SuspendToParentWindow(world, selected) + Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the + original position in the parent window. - *tlib#persistent#Filename()* -tlib#persistent#Filename(type, ?file=%, ?mkdir=0) + *tlib#agent#Suspend()* +tlib#agent#Suspend(world, selected) + Suspend lets you temporarily leave the input loop of + |tlib#input#List|. You can resume editing the list by pressing , + . , or in the suspended window. + and will immediatly select the item under the cursor. + < will select the item but the window will remain opened. - *tlib#persistent#Get()* -tlib#persistent#Get(...) + *tlib#agent#NewItem()* +tlib#agent#NewItem(world, selected) + Insert a new item below the current one. - *tlib#persistent#MTime()* -tlib#persistent#MTime(cfile) + *tlib#agent#GotoLine()* +tlib#agent#GotoLine(world, selected) + If not called from the scratch, we assume/guess that we don't have to + suspend the input-evaluation loop. - *tlib#persistent#Value()* -tlib#persistent#Value(...) - *tlib#persistent#Save()* -tlib#persistent#Save(cfile, dictionary) +------------------------------------------------------------------------ + *autoload/tlib/arg.vim* + *tlib#arg#Get()* +tlib#arg#Get(n, var, ?default="", ?test='') + Set a positional argument from a variable argument list. + See tlib#string#RemoveBackslashes() for an example. + *tlib#arg#Let()* +tlib#arg#Let(list, ?default='') + Set a positional arguments from a variable argument list. + See tlib#input#List() for an example. -======================================================================== -autoload/tlib/vim.vim~ + *tlib#arg#GetOpts()* +tlib#arg#GetOpts(args, ?def={}) + Convert a list of strings of command-line arguments into a dictonary. - *g:tlib#vim#simalt_maximize* -g:tlib#vim#simalt_maximize (default: 'x') - The alt-key for maximizing the window. - CAUTION: The value of this paramter depends on your locale and - maybe the windows version you are running. + The main use case is to pass [], i.e. the command-line + arguments of a command as list, from a command definition to this + function. - *g:tlib#vim#simalt_restore* -g:tlib#vim#simalt_restore (default: 'r') - The alt-key for restoring the window. - CAUTION: The value of this paramter depends on your locale and - maybe the windows version you are running. + Example: + ['-h'] + => If def contains a 'help' key, invoke |:help| on its value. - *g:tlib#vim#use_vimtweak* -g:tlib#vim#use_vimtweak (default: 0) - If true, use the vimtweak.dll for windows. This will enable - tlib to remove the caption for fullscreen windows. + ['-ab', '--foo', '--bar=BAR', 'bla', bla'] + => {'a': 1, 'b': 1, 'foo': 1, 'bar': 'BAR', '__rest__': ['bla', 'bla']} - *tlib#vim#Maximize()* -tlib#vim#Maximize(fullscreen) - Maximize the window. - You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't - work for you. + ['-ab', '--', '--foo', '--bar=BAR'] + => {'a': 1, 'b': 1, '__rest__': ['--foo', '--bar=BAR']} - *tlib#vim#RestoreWindow()* -tlib#vim#RestoreWindow() - Restore the original vimsize after having called |tlib#vim#Maximize()|. + *tlib#arg#Ex()* +tlib#arg#Ex(arg, ?chars='%#! ') + Escape some characters in a string. - *g:tlib#vim#use_wmctrl* -g:tlib#vim#use_wmctrl (default: executable('wmctrl')) - If true, use wmctrl for X windows to make a window - maximized/fullscreen. + Use |fnamescape()| if available. - This is the preferred method for maximizing windows under X - windows. Some window managers have problem coping with the - default method of setting 'lines' and 'columns' to a large - value. + EXAMPLES: > + exec 'edit '. tlib#arg#Ex('foo%#bar.txt') +< - *tlib#vim#CopyFunction()* -tlib#vim##CopyFunction(old, new, overwrite=0) +------------------------------------------------------------------------ + *autoload/tlib/assert.vim* + *tlib#assert#Enable()* +tlib#assert#Enable() + Enable tracing via |:Tlibassert|. -======================================================================== -autoload/tlib/progressbar.vim~ + *tlib#assert#Disable()* +tlib#assert#Disable() + Disable tracing via |:Tlibassert|. - *tlib#progressbar#Init()* -tlib#progressbar#Init(max, ...) - EXAMPLE: > - call tlib#progressbar#Init(20) - try - for i in range(20) - call tlib#progressbar#Display(i) - call DoSomethingThatTakesSomeTime(i) - endfor - finally - call tlib#progressbar#Restore() - endtry -< - *tlib#progressbar#Display()* -tlib#progressbar#Display(value, ...) +------------------------------------------------------------------------ + *autoload/tlib/buffer.vim* + *g:tlib_viewline_position* +g:tlib_viewline_position (default: 'zz') + Where to display the line when using |tlib#buffer#ViewLine|. + For possible values for position see |scroll-cursor|. - *tlib#progressbar#Restore()* -tlib#progressbar#Restore() + *tlib#buffer#Set()* +tlib#buffer#Set(buffer) + Set the buffer to buffer and return a command as string that can be + evaluated by |:execute| in order to restore the original view. + *tlib#buffer#Eval()* +tlib#buffer#Eval(buffer, code) + Evaluate CODE in BUFFER. -======================================================================== -autoload/tlib/selection.vim~ + EXAMPLES: > + call tlib#buffer#Eval('foo.txt', 'echo b:bar') +< - *tlib#selection#GetSelection()* -tlib#selection#GetSelection(mode, ?mbeg="'<", ?mend="'>", ?opmode='selection') - mode can be one of: selection, lines, block + *tlib#buffer#GetList()* +tlib#buffer#GetList(?show_hidden=0, ?show_number=0, " ?order='bufnr') + Possible values for the "order" argument: + bufnr :: Default behaviour + mru :: Sort buffers according to most recent use + basename :: Sort by the file's basename (last component) + NOTE: MRU order works on second invocation only. If you want to always + use MRU order, call tlib#buffer#EnableMRU() in your ~/.vimrc file. -======================================================================== -autoload/tlib/eval.vim~ + *tlib#buffer#ViewLine()* +tlib#buffer#ViewLine(line, ?position='z') + line is either a number or a string that begins with a number. + For possible values for position see |scroll-cursor|. + See also |g:tlib_viewline_position|. - *tlib#eval#FormatValue()* -tlib#eval#FormatValue(value, ...) + *tlib#buffer#DeleteRange()* +tlib#buffer#DeleteRange(line1, line2) + Delete the lines in the current buffer. Wrapper for |:delete|. - *tlib#eval#Extend()* -tlib#eval#Extend(a, b, ...) + *tlib#buffer#ReplaceRange()* +tlib#buffer#ReplaceRange(line1, line2, lines) + Replace a range of lines. + *tlib#buffer#ScratchStart()* +tlib#buffer#ScratchStart() + Initialize some scratch area at the bottom of the current buffer. -======================================================================== -autoload/tlib/list.vim~ + *tlib#buffer#ScratchEnd()* +tlib#buffer#ScratchEnd() + Remove the in-buffer scratch area. - *tlib#list#Inject()* -tlib#list#Inject(list, initial_value, funcref) - EXAMPLES: > - echo tlib#list#Inject([1,2,3], 0, function('Add') - => 6 -< + *tlib#buffer#BufDo()* +tlib#buffer#BufDo(exec) + Run exec on all buffers via bufdo and return to the original buffer. - *tlib#list#Compact()* -tlib#list#Compact(list) - EXAMPLES: > - tlib#list#Compact([0,1,2,3,[], {}, ""]) - => [1,2,3] -< + *tlib#buffer#InsertText()* +tlib#buffer#InsertText(text, keyargs) + Keyargs: + 'shift': 0|N + 'col': col('.')|N + 'lineno': line('.')|N + 'indent': 0|1 + 'pos': 'e'|'s' ... Where to locate the cursor (somewhat like s and e in {offset}) + Insert text (a string) in the buffer. - *tlib#list#Flatten()* -tlib#list#Flatten(list) - EXAMPLES: > - tlib#list#Flatten([0,[1,2,[3,""]]]) - => [0,1,2,3,""] -< + *tlib#buffer#KeepCursorPosition()* +tlib#buffer#KeepCursorPosition(cmd) + Evaluate cmd while maintaining the cursor position and jump registers. - *tlib#list#FindAll()* -tlib#list#FindAll(list, filter, ?process_expr="") - Basically the same as filter() - EXAMPLES: > - tlib#list#FindAll([1,2,3], 'v:val >= 2') - => [2, 3] +------------------------------------------------------------------------ + *autoload/tlib/cache.vim* + *g:tlib_cache* +g:tlib_cache (default: '') + The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'. + You might want to delete old files from this directory from time to + time with a command like: > + find ~/vimfiles/cache/ -atime +31 -type f -print -delete < - *tlib#list#Find()* -tlib#list#Find(list, filter, ?default="", ?process_expr="") + *g:tlib#cache#purge_days* +g:tlib#cache#purge_days (default: 31) + |tlib#cache#Purge()|: Remove cache files older than N days. - EXAMPLES: > - tlib#list#Find([1,2,3], 'v:val >= 2') - => 2 -< + *g:tlib#cache#purge_every_days* +g:tlib#cache#purge_every_days (default: 31) + Purge the cache every N days. Disable automatic purging by setting + this value to a negative value. - *tlib#list#Any()* -tlib#list#Any(list, expr) - EXAMPLES: > - tlib#list#Any([1,2,3], 'v:val >= 2') - => 1 -< + *g:tlib#cache#script_encoding* +g:tlib#cache#script_encoding (default: &enc) + The encoding used for the purge-cache script. + Default: 'enc' - *tlib#list#All()* -tlib#list#All(list, expr) - EXAMPLES: > - tlib#list#All([1,2,3], 'v:val >= 2') - => 0 -< + *g:tlib#cache#run_script* +g:tlib#cache#run_script (default: 1) + Whether to run the directory removal script: + 0 ... No + 1 ... Query user + 2 ... Yes - *tlib#list#Remove()* -tlib#list#Remove(list, element) - EXAMPLES: > - tlib#list#Remove([1,2,1,2], 2) - => [1,1,2] -< + *g:tlib#cache#verbosity* +g:tlib#cache#verbosity (default: 1) + Verbosity level: + 0 ... Be quiet + 1 ... Display informative message + 2 ... Display detailed messages - *tlib#list#RemoveAll()* -tlib#list#RemoveAll(list, element) - EXAMPLES: > - tlib#list#RemoveAll([1,2,1,2], 2) - => [1,1] -< + *g:tlib#cache#dont_purge* +g:tlib#cache#dont_purge (default: ['[\/]\.last_purge$']) + A list of regexps that are matched against partial filenames of the + cached files. If a regexp matches, the file won't be removed by + |tlib#cache#Purge()|. - *tlib#list#Zip()* -tlib#list#Zip(lists, ?default='') - EXAMPLES: > - tlib#list#Zip([[1,2,3], [4,5,6]]) - => [[1,4], [2,5], [3,6]] -< + *g:tlib#cache#max_filename* +g:tlib#cache#max_filename (default: 200) + If the cache filename is longer than N characters, use + |pathshorten()|. + + *tlib#cache#Dir()* +tlib#cache#Dir(?mode = 'bg') + The default cache directory. + + *tlib#cache#EncodedFilename()* +tlib#cache#EncodedFilename(type, file, ?mkdir=0, ?dir='') + Encode `file` and call |tlib#cache#Filename()|. + + *tlib#cache#Value()* +tlib#cache#Value(cfile, generator, ftime, ?generator_args=[], ?options={}) + Get a cached value from cfile. If it is outdated (compared to ftime) + or does not exist, create it calling a generator function. - *tlib#list#Uniq()* -tlib#list#Uniq(list, ...) + *tlib#cache#MaybePurge()* +tlib#cache#MaybePurge() + Call |tlib#cache#Purge()| if the last purge was done before + |g:tlib#cache#purge_every_days|. - *tlib#list#ToDictionary()* -tlib#list#ToDictionary(list, default, ...) + *tlib#cache#Purge()* +tlib#cache#Purge() + Delete old files. -======================================================================== -autoload/tlib/cmd.vim~ +------------------------------------------------------------------------ + *autoload/tlib/char.vim* + *tlib#char#Get()* +tlib#char#Get(?timeout=0) + Get a character. + + EXAMPLES: > + echo tlib#char#Get() + echo tlib#char#Get(5) +< - *tlib#cmd#OutputAsList()* -tlib#cmd#OutputAsList(command) +------------------------------------------------------------------------ + *autoload/tlib/cmd.vim* *tlib#cmd#BrowseOutput()* tlib#cmd#BrowseOutput(command) See |:TBrowseOutput|. @@ -837,15 +686,6 @@ call tlib#cmd#BrowseOutputWithCallback('tlib#cmd#ParseScriptname', 'scriptnames') < - *tlib#cmd#DefaultBrowseOutput()* -tlib#cmd#DefaultBrowseOutput(cmd) - - *tlib#cmd#ParseScriptname()* -tlib#cmd#ParseScriptname(line) - - *tlib#cmd#TBrowseScriptnames()* -tlib#cmd#TBrowseScriptnames() - *tlib#cmd#UseVertical()* tlib#cmd#UseVertical(?rx='') Look at the history whether the command was called with vertical. If @@ -857,1675 +697,888 @@ Print the time in seconds or milliseconds (if your version of VIM has |+reltime|) a command takes. - *tlib#cmd#Capture()* -tlib#cmd#Capture(cmd) +------------------------------------------------------------------------ + *autoload/tlib/comments.vim* + *tlib#comments#Comments()* +tlib#comments#Comments(...) + function! tlib#comments#Comments(?rx='') -======================================================================== -autoload/tlib/syntax.vim~ - *tlib#syntax#Collect()* -tlib#syntax#Collect() +------------------------------------------------------------------------ + *autoload/tlib/date.vim* + *tlib#date#SecondsSince1970()* +tlib#date#Parse(date, ?allow_zero=0, ?silent=0) "{{{3 + tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0) - *tlib#syntax#Names()* -tlib#syntax#Names(?rx='') +------------------------------------------------------------------------ + *autoload/tlib/dir.vim* + *g:tlib#dir#sep* +g:tlib#dir#sep (default: exists('+shellslash') && !&shellslash ? '\' : '/') + TLet g:tlib#dir#sep = '/' -======================================================================== -autoload/tlib/balloon.vim~ + *tlib#dir#CanonicName()* +tlib#dir#CanonicName(dirname) + EXAMPLES: > + tlib#dir#CanonicName('foo/bar') + => 'foo/bar/' +< - *tlib#balloon#Register()* -tlib#balloon#Register(expr) + *tlib#dir#NativeName()* +tlib#dir#NativeName(dirname) + EXAMPLES: > + tlib#dir#NativeName('foo/bar/') + On Windows: + => 'foo\bar\' + On Linux: + => 'foo/bar/' +< - *tlib#balloon#Remove()* -tlib#balloon#Remove(expr) + *tlib#dir#PlainName()* +tlib#dir#PlainName(dirname) + EXAMPLES: > + tlib#dir#PlainName('foo/bar/') + => 'foo/bar' +< - *tlib#balloon#Expr()* -tlib#balloon#Expr() + *tlib#dir#Ensure()* +tlib#dir#Ensure(dir) + Create a directory if it doesn't already exist. - *tlib#balloon#Expand()* -tlib#balloon#Expand(expr) + *tlib#dir#MyRuntime()* +tlib#dir#MyRuntime() + Return the first directory in &rtp. -======================================================================== -autoload/tlib/vcs.vim~ +------------------------------------------------------------------------ + *autoload/tlib/file.vim* + *g:tlib#file#drop* +g:tlib#file#drop (default: has('gui')) + If true, use |:drop| to edit loaded buffers (only available with GUI). - *g:tlib#vcs#def* -g:tlib#vcs#def {...} - A dictionarie of supported VCS (currently: git, hg, svn, bzr). + *tlib#file#Split()* +tlib#file#Split(filename) + EXAMPLES: > + tlib#file#Split('foo/bar/filename.txt') + => ['foo', 'bar', 'filename.txt'] +< - *g:tlib#vcs#executables* -g:tlib#vcs#executables {...} - A dictionary of custom executables for VCS commands. If the value is - empty, support for that VCS will be removed. If no key is present, it - is assumed that the VCS "type" is the name of the executable. + *tlib#file#Join()* +tlib#file#Join(filename_parts, ?strip_slashes=1, ?maybe_absolute=0) + EXAMPLES: > + tlib#file#Join(['foo', 'bar', 'filename.txt']) + => 'foo/bar/filename.txt' +< - *g:tlib#vcs#check* -g:tlib#vcs#check (default: has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s') - If non-empty, use it as a format string to check whether a VCS is - installed on your computer. + *tlib#file#Relative()* +tlib#file#Relative(filename, basedir) + EXAMPLES: > + tlib#file#Relative('foo/bar/filename.txt', 'foo') + => 'bar/filename.txt' +< - *tlib#vcs#Executable()* -tlib#vcs#Executable(type) + *tlib#file#Edit()* +tlib#file#Edit(fileid) + Return 0 if the file isn't readable/doesn't exist. + Otherwise return 1. - *tlib#vcs#FindVCS()* -tlib#vcs#FindVCS(filename) - *tlib#vcs#Ls()* -tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir]) - Return the files under VCS. +------------------------------------------------------------------------ + *autoload/tlib/hook.vim* + *tlib#hook#Run()* +tlib#hook#Run(hook, ?dict={}) + Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent. - *tlib#vcs#Diff()* -tlib#vcs#Diff(filename, ?vcs=[type, dir]) - Return the diff for "filename" - *tlib#vcs#GitLsPostprocess()* -tlib#vcs#GitLsPostprocess(filename) - - -======================================================================== -autoload/tlib/char.vim~ - - *tlib#char#Get()* -tlib#char#Get(?timeout=0) - Get a character. - - EXAMPLES: > - echo tlib#char#Get() - echo tlib#char#Get(5) -< - - *tlib#char#IsAvailable()* -tlib#char#IsAvailable() - - *tlib#char#GetWithTimeout()* -tlib#char#GetWithTimeout(timeout, ...) - - -======================================================================== -autoload/tlib/Filter_glob.vim~ - - *g:tlib#Filter_glob#seq* -g:tlib#Filter_glob#seq (default: '*') - A character that should be expanded to '\.\{-}'. - - *g:tlib#Filter_glob#char* -g:tlib#Filter_glob#char (default: '?') - A character that should be expanded to '\.\?'. - - *tlib#Filter_glob#New()* -tlib#Filter_glob#New(...) - The same as |tlib#Filter_cnf#New()| but a a customizable character - |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and - |g:tlib#Filter_glob#char| is expanded to '\.'. - The pattern is a '/\V' very no-'/magic' regexp pattern. - - -======================================================================== -autoload/tlib/scratch.vim~ - - *g:tlib_scratch_pos* -g:tlib_scratch_pos (default: 'botright') - Scratch window position. By default the list window is opened on the - bottom. Set this variable to 'topleft' or '' to change this behaviour. - See |tlib#input#List()|. - - *g:tlib#scratch#hidden* -g:tlib#scratch#hidden (default: 'hide') - If you want the scratch buffer to be fully removed, you might want to - set this variable to 'wipe'. - See also https://github.com/tomtom/tlib_vim/pull/16 - - *tlib#scratch#UseScratch()* -tlib#scratch#UseScratch(?keyargs={}) - Display a scratch buffer (a buffer with no file). See :TScratch for an - example. - Return the scratch buffer's number. - Values for keyargs: - scratch_split ... 1: split, 0: window, -1: tab - - *tlib#scratch#CloseScratch()* -tlib#scratch#CloseScratch(keyargs, ...) - Close a scratch buffer as defined in keyargs (usually a World). - Return 1 if the scratch buffer is closed (or if it already was - closed). - - -======================================================================== -autoload/tlib/autocmdgroup.vim~ - - *tlib#autocmdgroup#Init()* -tlib#autocmdgroup#Init() - - -======================================================================== -autoload/tlib/cache.vim~ - - *g:tlib_cache* -g:tlib_cache (default: '') - The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'. - You might want to delete old files from this directory from time to - time with a command like: > - find ~/vimfiles/cache/ -atime +31 -type f -print -delete -< - - *g:tlib#cache#purge_days* -g:tlib#cache#purge_days (default: 31) - |tlib#cache#Purge()|: Remove cache files older than N days. - - *g:tlib#cache#purge_every_days* -g:tlib#cache#purge_every_days (default: 31) - Purge the cache every N days. Disable automatic purging by setting - this value to a negative value. - - *g:tlib#cache#script_encoding* -g:tlib#cache#script_encoding (default: &enc) - The encoding used for the purge-cache script. - Default: 'enc' - - *g:tlib#cache#run_script* -g:tlib#cache#run_script (default: 1) - Whether to run the directory removal script: - 0 ... No - 1 ... Query user - 2 ... Yes - - *g:tlib#cache#verbosity* -g:tlib#cache#verbosity (default: 1) - Verbosity level: - 0 ... Be quiet - 1 ... Display informative message - 2 ... Display detailed messages - - *g:tlib#cache#dont_purge* -g:tlib#cache#dont_purge (default: ['[\/]\.last_purge$']) - A list of regexps that are matched against partial filenames of the - cached files. If a regexp matches, the file won't be removed by - |tlib#cache#Purge()|. - - *g:tlib#cache#max_filename* -g:tlib#cache#max_filename (default: 200) - If the cache filename is longer than N characters, use - |pathshorten()|. - - *tlib#cache#Dir()* -tlib#cache#Dir(?mode = 'bg') - The default cache directory. - - *tlib#cache#Filename()* -tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='') - - *tlib#cache#Save()* -tlib#cache#Save(cfile, dictionary, ...) - - *tlib#cache#MTime()* -tlib#cache#MTime(cfile) - - *tlib#cache#Get()* -tlib#cache#Get(cfile, ...) - - *tlib#cache#Value()* -tlib#cache#Value(cfile, generator, ftime, ?generator_args=[], ?options={}) - Get a cached value from cfile. If it is outdated (compared to ftime) - or does not exist, create it calling a generator function. - - *tlib#cache#MaybePurge()* -tlib#cache#MaybePurge() - Call |tlib#cache#Purge()| if the last purge was done before - |g:tlib#cache#purge_every_days|. - - *tlib#cache#Purge()* -tlib#cache#Purge() - Delete old files. - - *tlib#cache#ListFilesInCache()* -tlib#cache#ListFilesInCache(...) - - -======================================================================== -autoload/tlib/normal.vim~ - - *tlib#normal#WithRegister()* -tlib#normal#WithRegister(cmd, ?register='t', ?norm_cmd='norm!') - Execute a normal command while maintaining all registers. - - -======================================================================== -autoload/tlib/time.vim~ - - *tlib#time#MSecs()* -tlib#time#MSecs() - - *tlib#time#Now()* -tlib#time#Now() - - *tlib#time#FormatNow()* -tlib#time#FormatNow() - - *tlib#time#Diff()* -tlib#time#Diff(a, b, ...) - - *tlib#time#DiffMSecs()* -tlib#time#DiffMSecs(a, b, ...) - - -======================================================================== -autoload/tlib/var.vim~ - - *tlib#var#Let()* -tlib#var#Let(name, val) - Define a variable called NAME if yet undefined. - You can also use the :TLLet command. - - EXAMPLES: > - exec tlib#var#Let('g:foo', 1) - TLet g:foo = 1 -< - - *tlib#var#EGet()* -tlib#var#EGet(var, namespace, ?default='') - Retrieve a variable by searching several namespaces. - - EXAMPLES: > - let g:foo = 1 - let b:foo = 2 - let w:foo = 3 - echo eval(tlib#var#EGet('foo', 'vg')) => 1 - echo eval(tlib#var#EGet('foo', 'bg')) => 2 - echo eval(tlib#var#EGet('foo', 'wbg')) => 3 -< - - *tlib#var#Get()* -tlib#var#Get(var, namespace, ?default='') - Retrieve a variable by searching several namespaces. - - EXAMPLES: > - let g:foo = 1 - let b:foo = 2 - let w:foo = 3 - echo tlib#var#Get('foo', 'bg') => 1 - echo tlib#var#Get('foo', 'bg') => 2 - echo tlib#var#Get('foo', 'wbg') => 3 -< - - *tlib#var#List()* -tlib#var#List(rx, ?prefix='') - Get a list of variables matching rx. - EXAMPLE: - echo tlib#var#List('tlib_', 'g:') - - -======================================================================== -autoload/tlib/agent.vim~ -Various agents for use as key handlers in tlib#input#List() - - *g:tlib_scroll_lines* -g:tlib_scroll_lines (default: 10) - Number of items to move when pressing in the input list window. - - *tlib#agent#Exit()* -tlib#agent#Exit(world, selected) - - *tlib#agent#CopyItems()* -tlib#agent#CopyItems(world, selected) - - *tlib#agent#PageUp()* -tlib#agent#PageUp(world, selected) - - *tlib#agent#PageDown()* -tlib#agent#PageDown(world, selected) - - *tlib#agent#Home()* -tlib#agent#Home(world, selected) - - *tlib#agent#End()* -tlib#agent#End(world, selected) - - *tlib#agent#Up()* -tlib#agent#Up(world, selected, ...) - - *tlib#agent#Down()* -tlib#agent#Down(world, selected, ...) - - *tlib#agent#UpN()* -tlib#agent#UpN(world, selected) - - *tlib#agent#DownN()* -tlib#agent#DownN(world, selected) - - *tlib#agent#ShiftLeft()* -tlib#agent#ShiftLeft(world, selected) - - *tlib#agent#ShiftRight()* -tlib#agent#ShiftRight(world, selected) - - *tlib#agent#Reset()* -tlib#agent#Reset(world, selected) - - *tlib#agent#ToggleRestrictView()* -tlib#agent#ToggleRestrictView(world, selected) - - *tlib#agent#RestrictView()* -tlib#agent#RestrictView(world, selected) - - *tlib#agent#UnrestrictView()* -tlib#agent#UnrestrictView(world, selected) - - *tlib#agent#Input()* -tlib#agent#Input(world, selected) - - *tlib#agent#SuspendToParentWindow()* -tlib#agent#SuspendToParentWindow(world, selected) - Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the - original position in the parent window. - - *tlib#agent#Suspend()* -tlib#agent#Suspend(world, selected) - Suspend lets you temporarily leave the input loop of - |tlib#input#List|. You can resume editing the list by pressing , - . , or in the suspended window. - and will immediatly select the item under the cursor. - < will select the item but the window will remain opened. - - *tlib#agent#Help()* -tlib#agent#Help(world, selected) - - *tlib#agent#OR()* -tlib#agent#OR(world, selected) - - *tlib#agent#AND()* -tlib#agent#AND(world, selected) - - *tlib#agent#ReduceFilter()* -tlib#agent#ReduceFilter(world, selected) - - *tlib#agent#PopFilter()* -tlib#agent#PopFilter(world, selected) - - *tlib#agent#Debug()* -tlib#agent#Debug(world, selected) - - *tlib#agent#Select()* -tlib#agent#Select(world, selected) - - *tlib#agent#SelectUp()* -tlib#agent#SelectUp(world, selected) - - *tlib#agent#SelectDown()* -tlib#agent#SelectDown(world, selected) - - *tlib#agent#SelectAll()* -tlib#agent#SelectAll(world, selected) - - *tlib#agent#ToggleStickyList()* -tlib#agent#ToggleStickyList(world, selected) - - *tlib#agent#EditItem()* -tlib#agent#EditItem(world, selected) - - *tlib#agent#NewItem()* -tlib#agent#NewItem(world, selected) - Insert a new item below the current one. - - *tlib#agent#DeleteItems()* -tlib#agent#DeleteItems(world, selected) - - *tlib#agent#Cut()* -tlib#agent#Cut(world, selected) - - *tlib#agent#Copy()* -tlib#agent#Copy(world, selected) - - *tlib#agent#Paste()* -tlib#agent#Paste(world, selected) - - *tlib#agent#EditReturnValue()* -tlib#agent#EditReturnValue(world, rv) - - *tlib#agent#ViewFile()* -tlib#agent#ViewFile(world, selected) - - *tlib#agent#EditFile()* -tlib#agent#EditFile(world, selected) - - *tlib#agent#EditFileInSplit()* -tlib#agent#EditFileInSplit(world, selected) - - *tlib#agent#EditFileInVSplit()* -tlib#agent#EditFileInVSplit(world, selected) - - *tlib#agent#EditFileInTab()* -tlib#agent#EditFileInTab(world, selected) - - *tlib#agent#ToggleScrollbind()* -tlib#agent#ToggleScrollbind(world, selected) - - *tlib#agent#ShowInfo()* -tlib#agent#ShowInfo(world, selected) - - *tlib#agent#PreviewLine()* -tlib#agent#PreviewLine(world, selected) - - *tlib#agent#GotoLine()* -tlib#agent#GotoLine(world, selected) - If not called from the scratch, we assume/guess that we don't have to - suspend the input-evaluation loop. - - *tlib#agent#DoAtLine()* -tlib#agent#DoAtLine(world, selected) - - *tlib#agent#Wildcard()* -tlib#agent#Wildcard(world, selected) - - *tlib#agent#Null()* -tlib#agent#Null(world, selected) - - *tlib#agent#ExecAgentByName()* -tlib#agent#ExecAgentByName(world, selected) - - *tlib#agent#CompleteAgentNames()* -tlib#agent#CompleteAgentNames(ArgLead, CmdLine, CursorPos) - - *tlib#agent#Complete()* -tlib#agent#Complete(world, selected) - - -======================================================================== -autoload/tlib/bitwise.vim~ - - *tlib#bitwise#Num2Bits()* -tlib#bitwise#Num2Bits(num) - - *tlib#bitwise#Bits2Num()* -tlib#bitwise#Bits2Num(bits, ...) - - *tlib#bitwise#AND()* -tlib#bitwise#AND(num1, num2, ...) - - *tlib#bitwise#OR()* -tlib#bitwise#OR(num1, num2, ...) - - *tlib#bitwise#XOR()* -tlib#bitwise#XOR(num1, num2, ...) - - *tlib#bitwise#ShiftRight()* -tlib#bitwise#ShiftRight(bits, n) - - *tlib#bitwise#ShiftLeft()* -tlib#bitwise#ShiftLeft(bits, n) - - *tlib#bitwise#Add()* -tlib#bitwise#Add(num1, num2, ...) - - *tlib#bitwise#Sub()* -tlib#bitwise#Sub(num1, num2, ...) - - -======================================================================== -autoload/tlib/url.vim~ - - *tlib#url#Decode()* -tlib#url#Decode(url) - Decode an encoded URL. - - *tlib#url#DecodeChar()* -tlib#url#DecodeChar(char) - Decode a single character. - - *tlib#url#EncodeChar()* -tlib#url#EncodeChar(char) - Encode a single character. - - *tlib#url#Encode()* -tlib#url#Encode(url, ...) - Encode an URL. - - -======================================================================== -autoload/tlib/signs.vim~ - - *tlib#signs#ClearAll()* -tlib#signs#ClearAll(sign) - Clear all signs with name SIGN. - - *tlib#signs#ClearBuffer()* -tlib#signs#ClearBuffer(sign, bufnr) - Clear all signs with name SIGN in buffer BUFNR. - - *tlib#signs#Mark()* -tlib#signs#Mark(sign, list) - Add signs for all locations in LIST. LIST must adhere with the - quickfix list format (see |getqflist()|; only the fields lnum and - bufnr are required). - - list:: a quickfix or location list - sign:: a sign defined with |:sign-define| - - -======================================================================== -autoload/tlib/rx.vim~ - - *tlib#rx#Escape()* -tlib#rx#Escape(text, ?magic='m') - magic can be one of: m, M, v, V - See :help 'magic' - - *tlib#rx#EscapeReplace()* -tlib#rx#EscapeReplace(text, ?magic='m') - Escape return |sub-replace-special|. - - *tlib#rx#Suffixes()* -tlib#rx#Suffixes(...) - - *tlib#rx#LooksLikeRegexp()* -tlib#rx#LooksLikeRegexp(text) - - -======================================================================== -autoload/tlib/tag.vim~ - - *g:tlib_tags_extra* -g:tlib_tags_extra (default: '') - Extra tags for |tlib#tag#Retrieve()| (see there). Can also be buffer-local. - - *g:tlib_tag_substitute* -g:tlib_tag_substitute - Filter the tag description through |substitute()| for these filetypes. - This applies only if the tag cmd field (see |taglist()|) is used. - - *tlib#tag#Retrieve()* -tlib#tag#Retrieve(rx, ?extra_tags=0) - Get all tags matching rx. Basically, this function simply calls - |taglist()|, but when extra_tags is true, the list of the tag files - (see 'tags') is temporarily expanded with |g:tlib_tags_extra|. - - Example use: - If you want to include tags for, eg, JDK, normal tags use can become - slow. You could proceed as follows: - 1. Create a tags file for the JDK sources. When creating the tags - file, make sure to include inheritance information and the like - (command-line options like --fields=+iaSm --extra=+q should be ok). - In this example, we want tags only for public methods (there are - most likely better ways to do this): > - ctags -R --fields=+iaSm --extra=+q ${JAVA_HOME}/src - head -n 6 tags > tags0 - grep access:public tags >> tags0 -< 2. Make 'tags' include project specific tags files. In - ~/vimfiles/after/ftplugin/java.vim insert: > - let b:tlib_tags_extra = $JAVA_HOME .'/tags0' -< 3. When this function is invoked as > - echo tlib#tag#Retrieve('print') -< it will return only project-local tags. If it is invoked as > - echo tlib#tag#Retrieve('print', 1) -< tags from the JDK will be included. - - *tlib#tag#Collect()* -tlib#tag#Collect(constraints, ?use_extra=1, ?match_front=1) - Retrieve tags that meet the constraints (a dictionnary of fields and - regexp, with the exception of the kind field which is a list of chars). - For the use of the optional use_extra argument see - |tlib#tag#Retrieve()|. - - *tlib#tag#Format()* -tlib#tag#Format(tag) - - -======================================================================== -autoload/tlib/map.vim~ - - *tlib#map#PumAccept()* -tlib#map#PumAccept(key) - If |pumvisible()| is true, return "\". Otherwise return a:key. - For use in maps like: > - imap tlib#map#PumAccept("\") -< - - -======================================================================== -autoload/tlib/Filter_cnfd.vim~ - - *tlib#Filter_cnfd#New()* -tlib#Filter_cnfd#New(...) - The same as |tlib#Filter_cnf#New()| but a dot is expanded to '\.\{-}'. - As a consequence, patterns cannot match dots. - The pattern is a '/\V' very no-'/magic' regexp pattern. - - -======================================================================== -autoload/tlib/input.vim~ -Input-related, select from a list etc. - - *g:tlib#input#sortprefs_threshold* -g:tlib#input#sortprefs_threshold (default: 200) - If a list is bigger than this value, don't try to be smart when - selecting an item. Be slightly faster instead. - See |tlib#input#List()|. - - *g:tlib#input#livesearch_threshold* -g:tlib#input#livesearch_threshold (default: 1000) - If a list contains more items, |tlib#input#List()| does not perform an - incremental "live search" but uses |input()| to query the user for a - filter. This is useful on slower machines or with very long lists. - - *g:tlib#input#filter_mode* -g:tlib#input#filter_mode (default: 'glob') - Determine how |tlib#input#List()| and related functions work. - Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See: - glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|, - |g:tlib#Filter_glob#char|) are interpreted as glob-like - |wildcards| (this is the default method) - - Examples: - - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match - "far". - - Otherwise it is a derivate of the cnf method (see below). - - See also |tlib#Filter_glob#New()|. - cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is - expanded to "\.\{-}" - - A period character (".") acts as a wildcard as if ".\{-}" (see - |/\{-|) were entered. - - Examples: - - "f.o" matches "fo", "fxo", and "fxxxoo", but doesn't match - "far". - - Otherwise it is a derivate of the cnf method (see below). - - See also |tlib#Filter_cnfd#New()|. - cnf .... Match substrings - - A blank creates an AND conjunction, i.e. the next pattern has to - match too. - - A pipe character ("|") creates an OR conjunction, either this or - the next next pattern has to match. - - Patterns are very 'nomagic' |regexp| with a |\V| prefix. - - A pattern starting with "-" makes the filter exclude items - matching that pattern. - - Examples: - - "foo bar" matches items that contain the strings "foo" AND - "bar". - - "foo|bar boo|far" matches items that contain either ("foo" OR - "bar") AND ("boo" OR "far"). - - See also |tlib#Filter_cnf#New()|. - seq .... Match sequences of characters - - |tlib#Filter_seq#New()| - fuzzy .. Match fuzzy character sequences - - |tlib#Filter_fuzzy#New()| - - *g:tlib#input#higroup* -g:tlib#input#higroup (default: 'IncSearch') - The highlight group to use for showing matches in the input list - window. - See |tlib#input#List()|. - - *g:tlib_pick_last_item* -g:tlib_pick_last_item (default: 1) - When 1, automatically select the last remaining item only if the list - had only one item to begin with. - When 2, automatically select a last remaining item after applying - any filters. - See |tlib#input#List()|. - - -Keys for |tlib#input#List|~ - - *g:tlib#input#and* -g:tlib#input#and (default: ' ') - - *g:tlib#input#or* -g:tlib#input#or (default: '|') - - *g:tlib#input#not* -g:tlib#input#not (default: '-') - - *g:tlib#input#numeric_chars* -g:tlib#input#numeric_chars - When editing a list with |tlib#input#List|, typing these numeric chars - (as returned by getchar()) will select an item based on its index, not - based on its name. I.e. in the default setting, typing a "4" will - select the fourth item, not the item called "4". - In order to make keys 0-9 filter the items in the list and make - select an item by its index, remove the keys 48 to 57 from - this dictionary. - Format: [KEY] = BASE ... the number is calculated as KEY - BASE. - - *g:tlib#input#keyagents_InputList_s* -g:tlib#input#keyagents_InputList_s - The default key bindings for single-item-select list views. - - This variable is best customized via the variable - g:tlib_extend_keyagents_InputList_s. If you want to use , - to move the cursor up and down, add these two lines to your |vimrc| - file: - - let g:tlib_extend_keyagents_InputList_s = { - \ 10: 'tlib#agent#Down', - \ 11: 'tlib#agent#Up' - \ } - - *g:tlib#input#keyagents_InputList_m* -g:tlib#input#keyagents_InputList_m - - *g:tlib#input#handlers_EditList* -g:tlib#input#handlers_EditList - - *g:tlib#input#user_shortcuts* -g:tlib#input#user_shortcuts (default: {}) - A dictionary KEY => {'agent': AGENT, 'key_name': KEY_NAME} to - customize keyboard shortcuts in the list view. - - *g:tlib#input#use_popup* -g:tlib#input#use_popup (default: has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32'))) - If true, define a popup menu for |tlib#input#List()| and related - functions. - - *g:tlib#input#format_filename* -g:tlib#input#format_filename (default: 'l') - How to format filenames: - l ... Show basenames on the left side, separated from the - directory names - r ... Show basenames on the right side - - *g:tlib#input#filename_padding_r* -g:tlib#input#filename_padding_r (default: '&co / 10') - If g:tlib#input#format_filename == 'r', how much space should be kept - free on the right side. - - *g:tlib#input#filename_max_width* -g:tlib#input#filename_max_width (default: '&co / 2') - If g:tlib#input#format_filename == 'l', an expression that - |eval()|uates to the maximum display width of filenames. - - *tlib#input#List()* -tlib#input#List(type. ?query='', ?list=[], ?handlers=[], ?default="", ?timeout=0) - Select a single or multiple items from a list. Return either the list - of selected elements or its indexes. - - By default, typing numbers will select an item by its index. See - |g:tlib#input#numeric_chars| to find out how to change this. - - The item is automatically selected if the numbers typed equals the - number of digits of the list length. I.e. if a list contains 20 items, - typing 1 will first highlight item 1 but it won't select/use it - because 1 is an ambiguous input in this context. If you press enter, - the first item will be selected. If you press another digit (e.g. 0), - item 10 will be selected. Another way to select item 1 would be to - type 01. If the list contains only 9 items, typing 1 would select the - first item right away. - - type can be: - s ... Return one selected element - si ... Return the index of the selected element - m ... Return a list of selected elements - mi ... Return a list of indexes - - Several pattern matching styles are supported. See - |g:tlib#input#filter_mode|. - - Users can type to complete the current filter with the longest - match. - - EXAMPLES: > - echo tlib#input#List('s', 'Select one item', [100,200,300]) - echo tlib#input#List('si', 'Select one item', [100,200,300]) - echo tlib#input#List('m', 'Select one or more item(s)', [100,200,300]) - echo tlib#input#List('mi', 'Select one or more item(s)', [100,200,300]) - -< See ../samples/tlib/input/tlib_input_list.vim (move the cursor over - the filename and press gf) for a more elaborated example. - - *tlib#input#ListD()* -tlib#input#ListD(dict) - A wrapper for |tlib#input#ListW()| that builds |tlib#World#New| from - dict. - - *tlib#input#ListW()* -tlib#input#ListW(world, ?command='') - The second argument (command) is meant for internal use only. - The same as |tlib#input#List| but the arguments are packed into world - (an instance of tlib#World as returned by |tlib#World#New|). - - *tlib#input#EditList()* -tlib#input#EditList(query, list, ?timeout=0) - Edit a list. - - EXAMPLES: > - echo tlib#input#EditList('Edit:', [100,200,300]) -< - - *tlib#input#Resume()* -tlib#input#Resume(name, pick, bufnr) - - *tlib#input#CommandSelect()* -tlib#input#CommandSelect(command, ?keyargs={}) - Take a command, view the output, and let the user select an item from - its output. - - EXAMPLE: > - command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.') - command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+') -< - - *tlib#input#Edit()* -tlib#input#Edit(name, value, callback, ?cb_args=[]) - - Edit a value (asynchronously) in a scratch buffer. Use name for - identification. Call callback when done (or on cancel). - In the scratch buffer: - Press or to enter the new value, c to cancel - editing. - EXAMPLES: > - fun! FooContinue(success, text) - if a:success - let b:var = a:text - endif - endf - call tlib#input#Edit('foo', b:var, 'FooContinue') -< - - *tlib#input#Dialog()* -tlib#input#Dialog(text, options, default) - - -======================================================================== -autoload/tlib/number.vim~ - - *tlib#number#ConvertBase()* -tlib#number#ConvertBase(num, base, ...) - - -======================================================================== -autoload/tlib/file.vim~ - - *g:tlib#file#drop* -g:tlib#file#drop (default: has('gui')) - If true, use |:drop| to edit loaded buffers (only available with GUI). - - *g:tlib#file#use_tabs* -g:tlib#file#use_tabs (default: 0) - - *g:tlib#file#edit_cmds* -g:tlib#file#edit_cmds (default: g:tlib#file#use_tabs ? {'buffer': 'tab split | buffer', 'edit': 'tabedit'} : {}) - - *g:tlib#file#absolute_filename_rx* -g:tlib#file#absolute_filename_rx (default: '^\~\?[\/]') - - *tlib#file#Split()* -tlib#file#Split(filename) - EXAMPLES: > - tlib#file#Split('foo/bar/filename.txt') - => ['foo', 'bar', 'filename.txt'] -< - - *tlib#file#Join()* -tlib#file#Join(filename_parts, ?strip_slashes=1, ?maybe_absolute=0) - EXAMPLES: > - tlib#file#Join(['foo', 'bar', 'filename.txt']) - => 'foo/bar/filename.txt' -< - - *tlib#file#Relative()* -tlib#file#Relative(filename, basedir) - EXAMPLES: > - tlib#file#Relative('foo/bar/filename.txt', 'foo') - => 'bar/filename.txt' -< - - *tlib#file#Absolute()* -tlib#file#Absolute(filename, ...) - - *tlib#file#Canonic()* -tlib#file#Canonic(filename, ...) - - *tlib#file#With()* -tlib#file#With(fcmd, bcmd, files, ?world={}) - - *tlib#file#Edit()* -tlib#file#Edit(fileid) - Return 0 if the file isn't readable/doesn't exist. - Otherwise return 1. - - *tlib#file#Glob()* -tlib#file#Glob(pattern) - - *tlib#file#Globpath()* -tlib#file#Globpath(path, pattern) - - -======================================================================== -autoload/tlib/sys.vim~ - - *g:tlib#sys#special_protocols* -g:tlib#sys#special_protocols (default: ['https\?', 'nntp', 'mailto']) - A list of |regexp|s matching protocol names that should be handled - by |g:tlib#sys#system_browser|. - CAVEAT: Must be a |\V| |regexp|. - - *g:tlib#sys#special_suffixes* -g:tlib#sys#special_suffixes (default: ['xlsx\?', 'docx\?', 'pptx\?', 'accdb', 'mdb', 'sqlite', 'pdf', 'jpg', 'png', 'gif', 'od\[tspg]']) - A list of |regexp|s matching suffixes that should be handled by - |g:tlib#sys#system_browser|. - CAVEAT: Must be a |\V| |regexp|. - - *g:tlib#sys#system_rx* -g:tlib#sys#system_rx (default: printf('\V\%(\^\%(%s\):\|.\%(%s\)\$\)', join(g:tlib#sys#special_protocols, '\|'), join(g:tlib#sys#special_suffixes, '\|'))) - Open links matching this |regexp| with |g:tlib#sys#system_browser|. - CAVEAT: Must be a |\V| |regexp|. - - *g:tlib#sys#system_browser* -g:tlib#sys#system_browser (default: ...) - Open files in the system browser. - - *g:tlib#sys#windows* -g:tlib#sys#windows (default: &shell !~ 'sh' && (has('win16') || has('win32') || has('win64'))) - - *g:tlib#sys#null* -g:tlib#sys#null (default: g:tlib#sys#windows ? 'NUL' : (filereadable('/dev/null') ? '/dev/null' : '')) - - *tlib#sys#IsCygwinBin()* -tlib#sys#IsCygwinBin(cmd) - - *tlib#sys#IsExecutable()* -tlib#sys#IsExecutable(cmd, ...) - - *g:tlib#sys#check_cygpath* -g:tlib#sys#check_cygpath (default: g:tlib#sys#windows && tlib#sys#IsExecutable('cygpath', 1)) - If true, check whether we have to convert a path via cyppath -- - see |tlib#sys#MaybeUseCygpath| - - *g:tlib#sys#cygwin_path_rx* -g:tlib#sys#cygwin_path_rx (default: '/cygwin/') - If a full windows filename (with slashes instead of backslashes) - matches this |regexp|, it is assumed to be a cygwin executable. - - *g:tlib#sys#cygwin_expr* -g:tlib#sys#cygwin_expr (default: '"bash -c ''". escape(%s, "''\\") ."''"') - For cygwin binaries, convert command calls using this vim - expression. - - *tlib#sys#GetCmd()* -tlib#sys#GetCmd(cmd) - - *tlib#sys#MaybeUseCygpath()* -tlib#sys#MaybeUseCygpath(cmd) - If cmd seems to be a cygwin executable, use cygpath to convert - filenames. This assumes that cygwin's which command returns full - filenames for non-cygwin executables. - - *tlib#sys#ConvertPath()* -tlib#sys#ConvertPath(converter, filename) - - *tlib#sys#FileArgs()* -tlib#sys#FileArgs(cmd, files) - - *tlib#sys#IsSpecial()* -tlib#sys#IsSpecial(filename) - Check whether filename matches |g:tlib#sys#system_rx|, i.e. whether it - is a special file that should not be opened in vim. - - *tlib#sys#Open()* -tlib#sys#Open(filename) - Open filename with the default OS application (see - |g:tlib#sys#system_browser|), if |tlib#sys#IsSpecial()| return 1. - Returns 1 if successful or 0 otherwise. - - *tlib#sys#SystemInDir()* -tlib#sys#SystemInDir(dir, expr, ?input='') - - -======================================================================== -autoload/tlib/paragraph.vim~ - - *tlib#paragraph#GetMetric()* -tlib#paragraph#GetMetric() - Return an object describing a |paragraph|. - - *tlib#paragraph#Move()* -tlib#paragraph#Move(direction, count) - This function can be used with the tinymode plugin to move around - paragraphs. - - Example configuration: > - - call tinymode#EnterMap("para_move", "gp") - call tinymode#ModeMsg("para_move", "Move paragraph: j/k") - call tinymode#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '[N]')") - call tinymode#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '[N]')") - call tinymode#ModeArg("para_move", "owncount", 1) -< - - -======================================================================== -autoload/tlib/World.vim~ -A prototype used by |tlib#input#List|. -Inherits from |tlib#Object#New|. - - *g:tlib_inputlist_pct* -g:tlib_inputlist_pct (default: 50) - Size of the input list window (in percent) from the main size (of &lines). - See |tlib#input#List()|. +------------------------------------------------------------------------ + *autoload/tlib/input.vim* +Input-related, select from a list etc. - *g:tlib_inputlist_width_filename* -g:tlib_inputlist_width_filename (default: '&co / 3') - Size of filename columns when listing filenames. + *g:tlib#input#sortprefs_threshold* +g:tlib#input#sortprefs_threshold (default: 200) + If a list is bigger than this value, don't try to be smart when + selecting an item. Be slightly faster instead. See |tlib#input#List()|. - *g:tlib_inputlist_filename_indicators* -g:tlib_inputlist_filename_indicators (default: 0) - If true, |tlib#input#List()| will show some indicators about the - status of a filename (e.g. buflisted(), bufloaded() etc.). - This is disabled by default because vim checks also for the file on - disk when doing this. - - *g:tlib_inputlist_shortmessage* -g:tlib_inputlist_shortmessage (default: 0) - If not null, display only a short info about the filter. - - *tlib#World#New()* -tlib#World#New(...) - -prototype.PrintLines - -prototype.Suspend - - -======================================================================== -autoload/tlib/loclist.vim~ - - *tlib#loclist#Browse()* -tlib#loclist#Browse(...) - - -======================================================================== -autoload/tlib/tab.vim~ - - *tlib#tab#BufMap()* -tlib#tab#BufMap() - Return a dictionary of bufnumbers => [[tabpage, winnr] ...] - - *tlib#tab#TabWinNr()* -tlib#tab#TabWinNr(buffer) - Find a buffer's window at some tab page. - - *tlib#tab#Set()* -tlib#tab#Set(tabnr) - - -======================================================================== -autoload/tlib/date.vim~ - - *tlib#date#IsDate()* -tlib#date#IsDate(text) - - *tlib#date#Format()* -tlib#date#Format(secs1970) - - *tlib#date#DiffInDays()* -tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0) - - *tlib#date#Parse()* -tlib#date#Parse(date, ?allow_zero=0, ?silent=0) "{{{3 - - *tlib#date#SecondsSince1970()* -tlib#date#SecondsSince1970(date, ...) - tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0) - - *tlib#date#Shift()* -tlib#date#Shift(date, shift) - - -======================================================================== -autoload/tlib/type.vim~ - - *tlib#type#Enable()* -tlib#type#Enable() - Enable type assertiona via |:Tlibtype|. - - *tlib#type#Disable()* -tlib#type#Disable() - Disable type assertiona via |:Tlibtype|. - - *tlib#type#IsNumber()* -tlib#type#IsNumber(expr) - - *tlib#type#IsString()* -tlib#type#IsString(expr) - - *tlib#type#IsFuncref()* -tlib#type#IsFuncref(expr) - - *tlib#type#IsList()* -tlib#type#IsList(expr) - - *tlib#type#IsDictionary()* -tlib#type#IsDictionary(expr) - - *tlib#type#Is()* -tlib#type#Is(val, type) - - *tlib#type#Are()* -tlib#type#Are(vals, type) - - *tlib#type#Define()* -tlib#type#Define(name, schema) - - *tlib#type#Has()* -tlib#type#Has(val, schema) - - *tlib#type#Have()* -tlib#type#Have(vals, schema) - - *tlib#type#Check()* -tlib#type#Check(caller, names, vals) + *g:tlib#input#livesearch_threshold* +g:tlib#input#livesearch_threshold (default: 1000) + If a list contains more items, |tlib#input#List()| does not perform an + incremental "live search" but uses |input()| to query the user for a + filter. This is useful on slower machines or with very long lists. + *g:tlib#input#filter_mode* +g:tlib#input#filter_mode (default: 'glob') + Determine how |tlib#input#List()| and related functions work. + Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See: + glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|, + |g:tlib#Filter_glob#char|) are interpreted as glob-like + |wildcards| (this is the default method) + - Examples: + - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match + "far". + - Otherwise it is a derivate of the cnf method (see below). + - See also |tlib#Filter_glob#New()|. + cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is + expanded to "\.\{-}" + - A period character (".") acts as a wildcard as if ".\{-}" (see + |/\{-|) were entered. + - Examples: + - "f.o" matches "fo", "fxo", and "fxxxoo", but doesn't match + "far". + - Otherwise it is a derivate of the cnf method (see below). + - See also |tlib#Filter_cnfd#New()|. + cnf .... Match substrings + - A blank creates an AND conjunction, i.e. the next pattern has to + match too. + - A pipe character ("|") creates an OR conjunction, either this or + the next next pattern has to match. + - Patterns are very 'nomagic' |regexp| with a |\V| prefix. + - A pattern starting with "-" makes the filter exclude items + matching that pattern. + - Examples: + - "foo bar" matches items that contain the strings "foo" AND + "bar". + - "foo|bar boo|far" matches items that contain either ("foo" OR + "bar") AND ("boo" OR "far"). + - See also |tlib#Filter_cnf#New()|. + seq .... Match sequences of characters + - |tlib#Filter_seq#New()| + fuzzy .. Match fuzzy character sequences + - |tlib#Filter_fuzzy#New()| -======================================================================== -autoload/tlib/Filter_fuzzy.vim~ + *g:tlib#input#higroup* +g:tlib#input#higroup (default: 'IncSearch') + The highlight group to use for showing matches in the input list + window. + See |tlib#input#List()|. - *tlib#Filter_fuzzy#New()* -tlib#Filter_fuzzy#New(...) - Support for "fuzzy" pattern matching in |tlib#input#List()|. - Patterns are interpreted as if characters were connected with '.\{-}'. + *g:tlib_pick_last_item* +g:tlib_pick_last_item (default: 1) + When 1, automatically select the last remaining item only if the list + had only one item to begin with. + When 2, automatically select a last remaining item after applying + any filters. + See |tlib#input#List()|. - In "fuzzy" mode, the pretty printing of filenames is disabled. +Keys for |tlib#input#List|~ -======================================================================== -autoload/tlib/assert.vim~ + *g:tlib#input#numeric_chars* +g:tlib#input#numeric_chars + When editing a list with |tlib#input#List|, typing these numeric chars + (as returned by getchar()) will select an item based on its index, not + based on its name. I.e. in the default setting, typing a "4" will + select the fourth item, not the item called "4". + In order to make keys 0-9 filter the items in the list and make + select an item by its index, remove the keys 48 to 57 from + this dictionary. + Format: [KEY] = BASE ... the number is calculated as KEY - BASE. - *tlib#assert#Enable()* -tlib#assert#Enable() - Enable tracing via |:Tlibassert|. + *g:tlib#input#keyagents_InputList_s* +g:tlib#input#keyagents_InputList_s + The default key bindings for single-item-select list views. - *tlib#assert#Disable()* -tlib#assert#Disable() - Disable tracing via |:Tlibassert|. + This variable is best customized via the variable + g:tlib_extend_keyagents_InputList_s. If you want to use , + to move the cursor up and down, add these two lines to your |vimrc| + file: - *tlib#assert#Assert()* -tlib#assert#Assert(caller, check, vals) + let g:tlib_extend_keyagents_InputList_s = { + \ 10: 'tlib#agent#Down', + \ 11: 'tlib#agent#Up' + \ } - *tlib#assert#Map()* -tlib#assert#Map(vals, expr) + *g:tlib#input#user_shortcuts* +g:tlib#input#user_shortcuts (default: {}) + A dictionary KEY => {'agent': AGENT, 'key_name': KEY_NAME} to + customize keyboard shortcuts in the list view. - *tlib#assert#All()* -tlib#assert#All(vals) + *g:tlib#input#use_popup* +g:tlib#input#use_popup (default: has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32'))) + If true, define a popup menu for |tlib#input#List()| and related + functions. + *g:tlib#input#format_filename* +g:tlib#input#format_filename (default: 'l') + How to format filenames: + l ... Show basenames on the left side, separated from the + directory names + r ... Show basenames on the right side -======================================================================== -autoload/tlib/textobjects.vim~ + *g:tlib#input#filename_padding_r* +g:tlib#input#filename_padding_r (default: '&co / 10') + If g:tlib#input#format_filename == 'r', how much space should be kept + free on the right side. - *standard-paragraph* -tlib#textobjects#StandardParagraph() - Select a "Standard Paragraph", i.e. a text block followed by blank - lines. Other than |ap|, the last paragraph in a document is handled - just the same. + *g:tlib#input#filename_max_width* +g:tlib#input#filename_max_width (default: '&co / 2') + If g:tlib#input#format_filename == 'l', an expression that + |eval()|uates to the maximum display width of filenames. - The |text-object| can be accessed as "sp". Example: > + *tlib#input#List()* +tlib#input#List(type. ?query='', ?list=[], ?handlers=[], ?default="", ?timeout=0) + Select a single or multiple items from a list. Return either the list + of selected elements or its indexes. - vsp ... select the current standard paragraph + By default, typing numbers will select an item by its index. See + |g:tlib#input#numeric_chars| to find out how to change this. -< Return 1, if the paragraph is the last one in the document. + The item is automatically selected if the numbers typed equals the + number of digits of the list length. I.e. if a list contains 20 items, + typing 1 will first highlight item 1 but it won't select/use it + because 1 is an ambiguous input in this context. If you press enter, + the first item will be selected. If you press another digit (e.g. 0), + item 10 will be selected. Another way to select item 1 would be to + type 01. If the list contains only 9 items, typing 1 would select the + first item right away. - *tlib#textobjects#Init()* -tlib#textobjects#Init() + type can be: + s ... Return one selected element + si ... Return the index of the selected element + m ... Return a list of selected elements + mi ... Return a list of indexes - *v_sp* -v_sp ... :call tlib#textobjects#StandardParagraph() - sp ... Standard paragraph (for use as |text-objects|). + Several pattern matching styles are supported. See + |g:tlib#input#filter_mode|. - *o_sp* -o_sp ... :normal Vsp + Users can type to complete the current filter with the longest + match. + EXAMPLES: > + echo tlib#input#List('s', 'Select one item', [100,200,300]) + echo tlib#input#List('si', 'Select one item', [100,200,300]) + echo tlib#input#List('m', 'Select one or more item(s)', [100,200,300]) + echo tlib#input#List('mi', 'Select one or more item(s)', [100,200,300]) -======================================================================== -autoload/tlib/arg.vim~ +< See ../samples/tlib/input/tlib_input_list.vim (move the cursor over + the filename and press gf) for a more elaborated example. - *tlib#arg#Get()* -tlib#arg#Get(n, var, ?default="", ?test='') - Set a positional argument from a variable argument list. - See tlib#string#RemoveBackslashes() for an example. + *tlib#input#ListD()* +tlib#input#ListD(dict) + A wrapper for |tlib#input#ListW()| that builds |tlib#World#New| from + dict. - *tlib#arg#Let()* -tlib#arg#Let(list, ?default='') - Set a positional arguments from a variable argument list. - See tlib#input#List() for an example. + *tlib#input#ListW()* +tlib#input#ListW(world, ?command='') + The second argument (command) is meant for internal use only. + The same as |tlib#input#List| but the arguments are packed into world + (an instance of tlib#World as returned by |tlib#World#New|). - *tlib#arg#StringAsKeyArgs()* -tlib#arg#StringAsKeyArgs(string, ?keys=[], ?evaluate=0, ?sep=':', ?booleans=0) + *tlib#input#EditList()* +tlib#input#EditList(query, list, ?timeout=0) + Edit a list. - *tlib#arg#StringAsKeyArgsEqual()* -tlib#arg#StringAsKeyArgsEqual(string) + EXAMPLES: > + echo tlib#input#EditList('Edit:', [100,200,300]) +< - *tlib#arg#GetOpts()* -tlib#arg#GetOpts(args, ?def={}) - Convert a list of strings of command-line arguments into a dictonary. + *tlib#input#CommandSelect()* +tlib#input#CommandSelect(command, ?keyargs={}) + Take a command, view the output, and let the user select an item from + its output. - The main use case is to pass [], i.e. the command-line - arguments of a command as list, from a command definition to this - function. + EXAMPLE: > + command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.') + command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+') +< - Example: - ['-h'] - => If def contains a 'help' key, invoke |:help| on its value. + *tlib#input#Edit()* +tlib#input#Edit(name, value, callback, ?cb_args=[]) - ['-ab', '--foo', '--bar=BAR', 'bla', bla'] - => {'a': 1, 'b': 1, 'foo': 1, 'bar': 'BAR', '__rest__': ['bla', 'bla']} + Edit a value (asynchronously) in a scratch buffer. Use name for + identification. Call callback when done (or on cancel). + In the scratch buffer: + Press or to enter the new value, c to cancel + editing. + EXAMPLES: > + fun! FooContinue(success, text) + if a:success + let b:var = a:text + endif + endf + call tlib#input#Edit('foo', b:var, 'FooContinue') +< - ['-ab', '--', '--foo', '--bar=BAR'] - => {'a': 1, 'b': 1, '__rest__': ['--foo', '--bar=BAR']} - *tlib#arg#Ex()* -tlib#arg#Ex(arg, ?chars='%#! ') - Escape some characters in a string. +------------------------------------------------------------------------ + *autoload/tlib/list.vim* + *tlib#list#Inject()* +tlib#list#Inject(list, initial_value, funcref) + EXAMPLES: > + echo tlib#list#Inject([1,2,3], 0, function('Add') + => 6 +< - Use |fnamescape()| if available. + *tlib#list#Compact()* +tlib#list#Compact(list) + EXAMPLES: > + tlib#list#Compact([0,1,2,3,[], {}, ""]) + => [1,2,3] +< + *tlib#list#Flatten()* +tlib#list#Flatten(list) EXAMPLES: > - exec 'edit '. tlib#arg#Ex('foo%#bar.txt') + tlib#list#Flatten([0,[1,2,[3,""]]]) + => [0,1,2,3,""] < + *tlib#list#FindAll()* +tlib#list#FindAll(list, filter, ?process_expr="") + Basically the same as filter() -======================================================================== -autoload/tlib/fixes.vim~ + EXAMPLES: > + tlib#list#FindAll([1,2,3], 'v:val >= 2') + => [2, 3] +< - *tlib#fixes#Winpos()* -tlib#fixes#Winpos() + *tlib#list#Find()* +tlib#list#Find(list, filter, ?default="", ?process_expr="") + EXAMPLES: > + tlib#list#Find([1,2,3], 'v:val >= 2') + => 2 +< -======================================================================== -autoload/tlib/dir.vim~ + *tlib#list#Any()* +tlib#list#Any(list, expr) + EXAMPLES: > + tlib#list#Any([1,2,3], 'v:val >= 2') + => 1 +< - *g:tlib#dir#sep* -g:tlib#dir#sep (default: exists('+shellslash') && !&shellslash ? '\' : '/') - TLet g:tlib#dir#sep = '/' + *tlib#list#All()* +tlib#list#All(list, expr) + EXAMPLES: > + tlib#list#All([1,2,3], 'v:val >= 2') + => 0 +< - *tlib#dir#CanonicName()* -tlib#dir#CanonicName(dirname) + *tlib#list#Remove()* +tlib#list#Remove(list, element) EXAMPLES: > - tlib#dir#CanonicName('foo/bar') - => 'foo/bar/' + tlib#list#Remove([1,2,1,2], 2) + => [1,1,2] < - *tlib#dir#NativeName()* -tlib#dir#NativeName(dirname) + *tlib#list#RemoveAll()* +tlib#list#RemoveAll(list, element) EXAMPLES: > - tlib#dir#NativeName('foo/bar/') - On Windows: - => 'foo\bar\' - On Linux: - => 'foo/bar/' + tlib#list#RemoveAll([1,2,1,2], 2) + => [1,1] < - *tlib#dir#PlainName()* -tlib#dir#PlainName(dirname) + *tlib#list#Zip()* +tlib#list#Zip(lists, ?default='') EXAMPLES: > - tlib#dir#PlainName('foo/bar/') - => 'foo/bar' + tlib#list#Zip([[1,2,3], [4,5,6]]) + => [[1,4], [2,5], [3,6]] < - *tlib#dir#Ensure()* -tlib#dir#Ensure(dir) - Create a directory if it doesn't already exist. - *tlib#dir#MyRuntime()* -tlib#dir#MyRuntime() - Return the first directory in &rtp. +------------------------------------------------------------------------ + *autoload/tlib/map.vim* + *tlib#map#PumAccept()* +tlib#map#PumAccept(key) + If |pumvisible()| is true, return "\". Otherwise return a:key. + For use in maps like: > + imap tlib#map#PumAccept("\") +< - *tlib#dir#CD()* -tlib#dir#CD(dir, ?locally=0) - *tlib#dir#Push()* -tlib#dir#Push(dir, ?locally=0) +------------------------------------------------------------------------ + *autoload/tlib/normal.vim* + *tlib#normal#WithRegister()* +tlib#normal#WithRegister(cmd, ?register='t', ?norm_cmd='norm!') + Execute a normal command while maintaining all registers. - *tlib#dir#Pop()* -tlib#dir#Pop() +------------------------------------------------------------------------ + *autoload/tlib/notify.vim* + *tlib#notify#Echo()* +tlib#notify#Echo(text, ?style='') + Print text in the echo area. Temporarily disable 'ruler' and 'showcmd' + in order to prevent |press-enter| messages. -======================================================================== -autoload/tlib/hash.vim~ + *tlib#notify#TrimMessage()* +tlib#notify#TrimMessage(message) + Contributed by Erik Falor: + If the line containing the message is too long, echoing it will cause + a 'Hit ENTER' prompt to appear. This function cleans up the line so + that does not happen. + The echoed line is too long if it is wider than the width of the + window, minus cmdline space taken up by the ruler and showcmd + features. - *g:tlib#hash#use_crc32* -g:tlib#hash#use_crc32 (default: '') - *g:tlib#hash#use_adler32* -g:tlib#hash#use_adler32 (default: '') +------------------------------------------------------------------------ + *autoload/tlib/paragraph.vim* + *tlib#paragraph#GetMetric()* +tlib#paragraph#GetMetric() + Return an object describing a |paragraph|. - *tlib#hash#CRC32B()* -tlib#hash#CRC32B(chars) + *tlib#paragraph#Move()* +tlib#paragraph#Move(direction, count) + This function can be used with the tinymode plugin to move around + paragraphs. - *tlib#hash#CRC32B_ruby()* -tlib#hash#CRC32B_ruby(chars) + Example configuration: > - *tlib#hash#CRC32B_vim()* -tlib#hash#CRC32B_vim(chars) + call tinymode#EnterMap("para_move", "gp") + call tinymode#ModeMsg("para_move", "Move paragraph: j/k") + call tinymode#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '[N]')") + call tinymode#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '[N]')") + call tinymode#ModeArg("para_move", "owncount", 1) +< - *tlib#hash#Adler32()* -tlib#hash#Adler32(chars) - *tlib#hash#Adler32_vim()* -tlib#hash#Adler32_vim(chars) +------------------------------------------------------------------------ + *autoload/tlib/persistent.vim* + *g:tlib_persistent* +g:tlib_persistent (default: '') + The directory for persistent data files. If empty, use + |tlib#dir#MyRuntime|.'/share'. - *tlib#hash#Adler32_tlib()* -tlib#hash#Adler32_tlib(chars) + *tlib#persistent#Dir()* +tlib#persistent#Dir(?mode = 'bg') + Return the full directory name for persistent data files. -======================================================================== -autoload/tlib/win.vim~ +------------------------------------------------------------------------ + *autoload/tlib/progressbar.vim* + *tlib#progressbar#Init()* +tlib#progressbar#Init(max, ...) + EXAMPLE: > + call tlib#progressbar#Init(20) + try + for i in range(20) + call tlib#progressbar#Display(i) + call DoSomethingThatTakesSomeTime(i) + endfor + finally + call tlib#progressbar#Restore() + endtry +< - *tlib#win#Set()* -tlib#win#Set(winnr) - Return vim code to jump back to the original window. - *tlib#win#GetLayout()* -tlib#win#GetLayout(?save_view=0) +------------------------------------------------------------------------ + *autoload/tlib/rx.vim* + *tlib#rx#Escape()* +tlib#rx#Escape(text, ?magic='m') + magic can be one of: m, M, v, V + See :help 'magic' - *tlib#win#SetLayout()* -tlib#win#SetLayout(layout) + *tlib#rx#EscapeReplace()* +tlib#rx#EscapeReplace(text, ?magic='m') + Escape return |sub-replace-special|. - *tlib#win#List()* -tlib#win#List() - *tlib#win#Width()* -tlib#win#Width(wnr) +------------------------------------------------------------------------ + *autoload/tlib/scratch.vim* + *g:tlib_scratch_pos* +g:tlib_scratch_pos (default: 'botright') + Scratch window position. By default the list window is opened on the + bottom. Set this variable to 'topleft' or '' to change this behaviour. + See |tlib#input#List()|. - *tlib#win#WinDo()* -tlib#win#WinDo(ex) + *g:tlib#scratch#hidden* +g:tlib#scratch#hidden (default: 'hide') + If you want the scratch buffer to be fully removed, you might want to + set this variable to 'wipe'. + See also https://github.com/tomtom/tlib_vim/pull/16 + *tlib#scratch#UseScratch()* +tlib#scratch#UseScratch(?keyargs={}) + Display a scratch buffer (a buffer with no file). See :TScratch for an + example. + Return the scratch buffer's number. + Values for keyargs: + scratch_split ... 1: split, 0: window, -1: tab -======================================================================== -autoload/tlib/comments.vim~ + *tlib#scratch#CloseScratch()* +tlib#scratch#CloseScratch(keyargs, ...) + Close a scratch buffer as defined in keyargs (usually a World). + Return 1 if the scratch buffer is closed (or if it already was + closed). - *tlib#comments#Comments()* -tlib#comments#Comments(...) - function! tlib#comments#Comments(?rx='') +------------------------------------------------------------------------ + *autoload/tlib/selection.vim* + *tlib#selection#GetSelection()* +tlib#selection#GetSelection(mode, ?mbeg="'<", ?mend="'>", ?opmode='selection') + mode can be one of: selection, lines, block -======================================================================== -autoload/tlib/grep.vim~ - *tlib#grep#Do()* -tlib#grep#Do(cmd, rx, files) +------------------------------------------------------------------------ + *autoload/tlib/signs.vim* + *tlib#signs#ClearAll()* +tlib#signs#ClearAll(sign) + Clear all signs with name SIGN. + + *tlib#signs#ClearBuffer()* +tlib#signs#ClearBuffer(sign, bufnr) + Clear all signs with name SIGN in buffer BUFNR. + + *tlib#signs#Mark()* +tlib#signs#Mark(sign, list) + Add signs for all locations in LIST. LIST must adhere with the + quickfix list format (see |getqflist()|; only the fields lnum and + bufnr are required). - *tlib#grep#LocList()* -tlib#grep#LocList(rx, files) + list:: a quickfix or location list + sign:: a sign defined with |:sign-define| - *tlib#grep#QuickFixList()* -tlib#grep#QuickFixList(rx, files) - *tlib#grep#List()* -tlib#grep#List(rx, files) +------------------------------------------------------------------------ + *autoload/tlib/string.vim* + *tlib#string#RemoveBackslashes()* +tlib#string#RemoveBackslashes(text, ?chars=' ') + Remove backslashes from text (but only in front of the characters in + chars). + *tlib#string#Format()* +tlib#string#Chomp(string, ?max=0) + Format a template string. Placeholders have the format "%{NAME}". A + "%" can be inserted as "%%". -======================================================================== -autoload/tlib/qfl.vim~ + Examples: + echo tlib#string#Format("foo %{bar} foo", {'bar': 123}) + => foo 123 foo - *tlib#qfl#FormatQFLE()* -tlib#qfl#FormatQFLE(qfe) + *tlib#string#Printf1()* +tlib#string#Printf1(format, string) + This function deviates from |printf()| in certain ways. + Additional items: + %{rx} ... insert escaped regexp + %{fuzzyrx} ... insert typo-tolerant regexp - *tlib#qfl#QfeFilename()* -tlib#qfl#QfeFilename(qfe) - *tlib#qfl#InitListBuffer()* -tlib#qfl#InitListBuffer(world) +------------------------------------------------------------------------ + *autoload/tlib/sys.vim* + *g:tlib#sys#special_protocols* +g:tlib#sys#special_protocols (default: ['https\?', 'nntp', 'mailto']) + A list of |regexp|s matching protocol names that should be handled + by |g:tlib#sys#system_browser|. + CAVEAT: Must be a |\V| |regexp|. - *tlib#qfl#SetSyntax()* -tlib#qfl#SetSyntax() + *g:tlib#sys#special_suffixes* +g:tlib#sys#special_suffixes (default: ['xlsx\?', 'docx\?', 'pptx\?', 'accdb', 'mdb', 'sqlite', 'pdf', 'jpg', 'png', 'gif', 'od\[tspg]']) + A list of |regexp|s matching suffixes that should be handled by + |g:tlib#sys#system_browser|. + CAVEAT: Must be a |\V| |regexp|. - *tlib#qfl#Balloon()* -tlib#qfl#Balloon() + *g:tlib#sys#system_rx* +g:tlib#sys#system_rx (default: printf('\V\%(\^\%(%s\):\|.\%(%s\)\$\)', join(g:tlib#sys#special_protocols, '\|'), join(g:tlib#sys#special_suffixes, '\|'))) + Open links matching this |regexp| with |g:tlib#sys#system_browser|. + CAVEAT: Must be a |\V| |regexp|. - *tlib#qfl#AgentEditQFE()* -tlib#qfl#AgentEditQFE(world, selected, ...) + *g:tlib#sys#system_browser* +g:tlib#sys#system_browser (default: ...) + Open files in the system browser. - *tlib#qfl#AgentPreviewQFE()* -tlib#qfl#AgentPreviewQFE(world, selected) + *g:tlib#sys#check_cygpath* +g:tlib#sys#check_cygpath (default: g:tlib#sys#windows && tlib#sys#IsExecutable('cygpath', 1)) + If true, check whether we have to convert a path via cyppath -- + see |tlib#sys#MaybeUseCygpath| - *tlib#qfl#AgentGotoQFE()* -tlib#qfl#AgentGotoQFE(world, selected) + *g:tlib#sys#cygwin_path_rx* +g:tlib#sys#cygwin_path_rx (default: '/cygwin/') + If a full windows filename (with slashes instead of backslashes) + matches this |regexp|, it is assumed to be a cygwin executable. - *tlib#qfl#AgentWithSelected()* -tlib#qfl#AgentWithSelected(world, selected, ...) + *g:tlib#sys#cygwin_expr* +g:tlib#sys#cygwin_expr (default: '"bash -c ''". escape(%s, "''\\") ."''"') + For cygwin binaries, convert command calls using this vim + expression. - *tlib#qfl#RunCmdOnSelected()* -tlib#qfl#RunCmdOnSelected(world, selected, cmd, ...) + *tlib#sys#MaybeUseCygpath()* +tlib#sys#MaybeUseCygpath(cmd) + If cmd seems to be a cygwin executable, use cygpath to convert + filenames. This assumes that cygwin's which command returns full + filenames for non-cygwin executables. - *tlib#qfl#AgentSplitBuffer()* -tlib#qfl#AgentSplitBuffer(world, selected) + *tlib#sys#IsSpecial()* +tlib#sys#IsSpecial(filename) + Check whether filename matches |g:tlib#sys#system_rx|, i.e. whether it + is a special file that should not be opened in vim. - *tlib#qfl#AgentTabBuffer()* -tlib#qfl#AgentTabBuffer(world, selected) + *tlib#sys#Open()* +tlib#sys#Open(filename) + Open filename with the default OS application (see + |g:tlib#sys#system_browser|), if |tlib#sys#IsSpecial()| return 1. + Returns 1 if successful or 0 otherwise. - *tlib#qfl#AgentVSplitBuffer()* -tlib#qfl#AgentVSplitBuffer(world, selected) + *tlib#sys#OpenWithSystemViewer()* +tlib#sys#OpenWithSystemViewer(filename) + Open filename with the default system viewer. - *tlib#qfl#AgentEditLine()* -tlib#qfl#AgentEditLine(world, selected) - *tlib#qfl#EditLine()* -tlib#qfl#EditLine(lnum) +------------------------------------------------------------------------ + *autoload/tlib/tab.vim* + *tlib#tab#BufMap()* +tlib#tab#BufMap() + Return a dictionary of bufnumbers => [[tabpage, winnr] ...] - *tlib#qfl#SetFollowCursor()* -tlib#qfl#SetFollowCursor(world, selected) + *tlib#tab#TabWinNr()* +tlib#tab#TabWinNr(buffer) + Find a buffer's window at some tab page. - *tlib#qfl#QflList()* -tlib#qfl#QflList(list, ...) - *tlib#qfl#Browse()* -tlib#qfl#Browse(...) +------------------------------------------------------------------------ + *autoload/tlib/tag.vim* + *g:tlib_tags_extra* +g:tlib_tags_extra (default: '') + Extra tags for |tlib#tag#Retrieve()| (see there). Can also be buffer-local. + *g:tlib_tag_substitute* +g:tlib_tag_substitute + Filter the tag description through |substitute()| for these filetypes. + This applies only if the tag cmd field (see |taglist()|) is used. -======================================================================== -autoload/tlib/Filter_cnf.vim~ + *tlib#tag#Retrieve()* +tlib#tag#Retrieve(rx, ?extra_tags=0) + Get all tags matching rx. Basically, this function simply calls + |taglist()|, but when extra_tags is true, the list of the tag files + (see 'tags') is temporarily expanded with |g:tlib_tags_extra|. - *tlib#Filter_cnf#New()* -tlib#Filter_cnf#New(...) - The search pattern for |tlib#input#List()| is in conjunctive normal - form: (P1 OR P2 ...) AND (P3 OR P4 ...) ... - The pattern is a '/\V' very no-'/magic' regexp pattern. + Example use: + If you want to include tags for, eg, JDK, normal tags use can become + slow. You could proceed as follows: + 1. Create a tags file for the JDK sources. When creating the tags + file, make sure to include inheritance information and the like + (command-line options like --fields=+iaSm --extra=+q should be ok). + In this example, we want tags only for public methods (there are + most likely better ways to do this): > + ctags -R --fields=+iaSm --extra=+q ${JAVA_HOME}/src + head -n 6 tags > tags0 + grep access:public tags >> tags0 +< 2. Make 'tags' include project specific tags files. In + ~/vimfiles/after/ftplugin/java.vim insert: > + let b:tlib_tags_extra = $JAVA_HOME .'/tags0' +< 3. When this function is invoked as > + echo tlib#tag#Retrieve('print') +< it will return only project-local tags. If it is invoked as > + echo tlib#tag#Retrieve('print', 1) +< tags from the JDK will be included. - Pressing joins two patterns with AND. - Pressing | joins two patterns with OR. - I.e. In order to get "lala AND (foo OR bar)", you type - "lala foo|bar". + *tlib#tag#Collect()* +tlib#tag#Collect(constraints, ?use_extra=1, ?match_front=1) + Retrieve tags that meet the constraints (a dictionnary of fields and + regexp, with the exception of the kind field which is a list of chars). + For the use of the optional use_extra argument see + |tlib#tag#Retrieve()|. - This is also the base class for other filters. -prototype.Pretty +------------------------------------------------------------------------ + *autoload/tlib/textobjects.vim* + *standard-paragraph* +tlib#textobjects#StandardParagraph() + Select a "Standard Paragraph", i.e. a text block followed by blank + lines. Other than |ap|, the last paragraph in a document is handled + just the same. + The |text-object| can be accessed as "sp". Example: > -======================================================================== -autoload/tlib/Object.vim~ -Provides a prototype plus some OO-like methods. + vsp ... select the current standard paragraph - *tlib#Object#New()* -tlib#Object#New(?fields={}) - This function creates a prototype that provides some kind of - inheritance mechanism and a way to call parent/super methods. +< Return 1, if the paragraph is the last one in the document. - The usage demonstrated in the following example works best when every - class/prototype is defined in a file of its own. + *v_sp* +v_sp ... :call tlib#textobjects#StandardParagraph() + sp ... Standard paragraph (for use as |text-objects|). - The reason for why there is a dedicated constructor function is that - this layout facilitates the use of templates and that methods are - hidden from the user. Other solutions are possible. - EXAMPLES: > - let s:prototype = tlib#Object#New({ - \ '_class': ['FooBar'], - \ 'foo': 1, - \ 'bar': 2, - \ }) - " Constructor - function! FooBar(...) - let object = s:prototype.New(a:0 >= 1 ? a:1 : {}) - return object - endf - function! s:prototype.babble() { - echo "I think, therefore I am ". (self.foo * self.bar) ." months old." - } +------------------------------------------------------------------------ + *autoload/tlib/trace.vim* + *g:tlib#trace#backtrace* +g:tlib#trace#backtrace (default: 2) + The length of the backtrace that should be included in + |tlib#trace#Print()|. -< This could now be used like this: > - let myfoo = FooBar({'foo': 3}) - call myfoo.babble() - => I think, therefore I am 6 months old. - echo myfoo.IsA('FooBar') - => 1 - echo myfoo.IsA('object') - => 1 - echo myfoo.IsA('Foo') - => 0 - echo myfoo.RespondTo('babble') - => 1 - echo myfoo.RespondTo('speak') - => 0 -< + *g:tlib#trace#printer* +g:tlib#trace#printer (default: 'echom') + Possible values: + - 'echom' + - ['file', FILENAME] + + *tlib#trace#Printer_echom()* +tlib#trace#Printer_echom(type, text, args) + Print traces from |tlib#trace#Print()|. -prototype.New + *tlib#trace#Set()* +tlib#trace#Set(vars, ...) + Set the tracing |regexp|. See |:Tlibtrace|. + This will also call |tlib#trace#Enable()|. -prototype.Inherit + Examples: + call tlib#trace#Set(["+foo", "-bar"]) + call tlib#trace#Set("+foo,-bar") -prototype.Extend + *tlib#trace#Print()* +tlib#trace#Print(caller, vars, values) + Print the values of vars. The first value is a "guard" (see + |:Tlibtrace|). -prototype.IsA + *tlib#trace#Enable()* +tlib#trace#Enable() + Enable tracing via |:Tlibtrace|. -prototype.IsRelated + *tlib#trace#Disable()* +tlib#trace#Disable() + Disable tracing via |:Tlibtrace|. -prototype.RespondTo -prototype.Super +------------------------------------------------------------------------ + *autoload/tlib/type.vim* + *tlib#type#Enable()* +tlib#type#Enable() + Enable type assertiona via |:Tlibtype|. - *tlib#Object#Methods()* -tlib#Object#Methods(object, ...) + *tlib#type#Disable()* +tlib#type#Disable() + Disable type assertiona via |:Tlibtype|. -======================================================================== -autoload/tlib/buffer.vim~ +------------------------------------------------------------------------ + *autoload/tlib/url.vim* + *tlib#url#Decode()* +tlib#url#Decode(url) + Decode an encoded URL. - *g:tlib_viewline_position* -g:tlib_viewline_position (default: 'zz') - Where to display the line when using |tlib#buffer#ViewLine|. - For possible values for position see |scroll-cursor|. + *tlib#url#DecodeChar()* +tlib#url#DecodeChar(char) + Decode a single character. - *tlib#buffer#EnableMRU()* -tlib#buffer#EnableMRU() + *tlib#url#EncodeChar()* +tlib#url#EncodeChar(char) + Encode a single character. - *tlib#buffer#DisableMRU()* -tlib#buffer#DisableMRU() + *tlib#url#Encode()* +tlib#url#Encode(url, ...) + Encode an URL. - *tlib#buffer#Set()* -tlib#buffer#Set(buffer) - Set the buffer to buffer and return a command as string that can be - evaluated by |:execute| in order to restore the original view. - *tlib#buffer#Eval()* -tlib#buffer#Eval(buffer, code) - Evaluate CODE in BUFFER. +------------------------------------------------------------------------ + *autoload/tlib/var.vim* + *tlib#var#Let()* +tlib#var#Let(name, val) + Define a variable called NAME if yet undefined. + You can also use the :TLLet command. EXAMPLES: > - call tlib#buffer#Eval('foo.txt', 'echo b:bar') + exec tlib#var#Let('g:foo', 1) + TLet g:foo = 1 < - *tlib#buffer#GetList()* -tlib#buffer#GetList(?show_hidden=0, ?show_number=0, " ?order='bufnr') - Possible values for the "order" argument: - bufnr :: Default behaviour - mru :: Sort buffers according to most recent use - basename :: Sort by the file's basename (last component) - - NOTE: MRU order works on second invocation only. If you want to always - use MRU order, call tlib#buffer#EnableMRU() in your ~/.vimrc file. - - *tlib#buffer#ViewLine()* -tlib#buffer#ViewLine(line, ?position='z') - line is either a number or a string that begins with a number. - For possible values for position see |scroll-cursor|. - See also |g:tlib_viewline_position|. - - *tlib#buffer#HighlightLine()* -tlib#buffer#HighlightLine(...) - - *tlib#buffer#DeleteRange()* -tlib#buffer#DeleteRange(line1, line2) - Delete the lines in the current buffer. Wrapper for |:delete|. - - *tlib#buffer#ReplaceRange()* -tlib#buffer#ReplaceRange(line1, line2, lines) - Replace a range of lines. - - *tlib#buffer#ScratchStart()* -tlib#buffer#ScratchStart() - Initialize some scratch area at the bottom of the current buffer. + *tlib#var#EGet()* +tlib#var#EGet(var, namespace, ?default='') + Retrieve a variable by searching several namespaces. - *tlib#buffer#ScratchEnd()* -tlib#buffer#ScratchEnd() - Remove the in-buffer scratch area. + EXAMPLES: > + let g:foo = 1 + let b:foo = 2 + let w:foo = 3 + echo eval(tlib#var#EGet('foo', 'vg')) => 1 + echo eval(tlib#var#EGet('foo', 'bg')) => 2 + echo eval(tlib#var#EGet('foo', 'wbg')) => 3 +< - *tlib#buffer#BufDo()* -tlib#buffer#BufDo(exec) - Run exec on all buffers via bufdo and return to the original buffer. + *tlib#var#Get()* +tlib#var#Get(var, namespace, ?default='') + Retrieve a variable by searching several namespaces. - *tlib#buffer#InsertText()* -tlib#buffer#InsertText(text, keyargs) - Keyargs: - 'shift': 0|N - 'col': col('.')|N - 'lineno': line('.')|N - 'indent': 0|1 - 'pos': 'e'|'s' ... Where to locate the cursor (somewhat like s and e in {offset}) - Insert text (a string) in the buffer. + EXAMPLES: > + let g:foo = 1 + let b:foo = 2 + let w:foo = 3 + echo tlib#var#Get('foo', 'bg') => 1 + echo tlib#var#Get('foo', 'bg') => 2 + echo tlib#var#Get('foo', 'wbg') => 3 +< - *tlib#buffer#InsertText0()* -tlib#buffer#InsertText0(text, ...) + *tlib#var#List()* +tlib#var#List(rx, ?prefix='') + Get a list of variables matching rx. + EXAMPLE: + echo tlib#var#List('tlib_', 'g:') - *tlib#buffer#CurrentByte()* -tlib#buffer#CurrentByte() - *tlib#buffer#KeepCursorPosition()* -tlib#buffer#KeepCursorPosition(cmd) - Evaluate cmd while maintaining the cursor position and jump registers. +------------------------------------------------------------------------ + *autoload/tlib/vcs.vim* + *g:tlib#vcs#def* +g:tlib#vcs#def {...} + A dictionarie of supported VCS (currently: git, hg, svn, bzr). + *g:tlib#vcs#executables* +g:tlib#vcs#executables {...} + A dictionary of custom executables for VCS commands. If the value is + empty, support for that VCS will be removed. If no key is present, it + is assumed that the VCS "type" is the name of the executable. -======================================================================== -autoload/tlib/hook.vim~ + *g:tlib#vcs#check* +g:tlib#vcs#check (default: has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s') + If non-empty, use it as a format string to check whether a VCS is + installed on your computer. - *tlib#hook#Run()* -tlib#hook#Run(hook, ?dict={}) - Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent. + *tlib#vcs#Ls()* +tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir]) + Return the files under VCS. + *tlib#vcs#Diff()* +tlib#vcs#Diff(filename, ?vcs=[type, dir]) + Return the diff for "filename" -======================================================================== -autoload/tlib/string.vim~ - *tlib#string#RemoveBackslashes()* -tlib#string#RemoveBackslashes(text, ?chars=' ') - Remove backslashes from text (but only in front of the characters in - chars). +------------------------------------------------------------------------ + *autoload/tlib/vim.vim* + *g:tlib#vim#simalt_maximize* +g:tlib#vim#simalt_maximize (default: 'x') + The alt-key for maximizing the window. + CAUTION: The value of this paramter depends on your locale and + maybe the windows version you are running. - *tlib#string#Chomp()* -tlib#string#Chomp(string, ?max=0) + *g:tlib#vim#simalt_restore* +g:tlib#vim#simalt_restore (default: 'r') + The alt-key for restoring the window. + CAUTION: The value of this paramter depends on your locale and + maybe the windows version you are running. - *tlib#string#Format()* -tlib#string#Format(template, dict) + *g:tlib#vim#use_vimtweak* +g:tlib#vim#use_vimtweak (default: 0) + If true, use the vimtweak.dll for windows. This will enable + tlib to remove the caption for fullscreen windows. - *tlib#string#Printf1()* -tlib#string#Printf1(format, string) - This function deviates from |printf()| in certain ways. - Additional items: - %{rx} ... insert escaped regexp - %{fuzzyrx} ... insert typo-tolerant regexp + *tlib#vim#Maximize()* +tlib#vim#Maximize(fullscreen) + Maximize the window. + You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't + work for you. - *tlib#string#TrimLeft()* -tlib#string#TrimLeft(string) + *tlib#vim#RestoreWindow()* +tlib#vim#RestoreWindow() + Restore the original vimsize after having called |tlib#vim#Maximize()|. - *tlib#string#TrimRight()* -tlib#string#TrimRight(string) + *g:tlib#vim#use_wmctrl* +g:tlib#vim#use_wmctrl (default: executable('wmctrl')) + If true, use wmctrl for X windows to make a window + maximized/fullscreen. - *tlib#string#Strip()* -tlib#string#Strip(string) + This is the preferred method for maximizing windows under X + windows. Some window managers have problem coping with the + default method of setting 'lines' and 'columns' to a large + value. - *tlib#string#Count()* -tlib#string#Count(string, rx) - *tlib#string#SplitCommaList()* -tlib#string#SplitCommaList(text, ...) +------------------------------------------------------------------------ + *autoload/tlib/win.vim* + *tlib#win#Set()* +tlib#win#Set(winnr) + Return vim code to jump back to the original window. - *tlib#string#Input()* -tlib#string#Input(...) + *tlib#win#SetById()* +tlib#win#SetById(win_id) + Return vim code to jump back to the original window. diff -Nru vim-tlib-1.20/.gitignore vim-tlib-1.23/.gitignore --- vim-tlib-1.20/.gitignore 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/.gitignore 2017-03-16 19:32:34.000000000 +0000 @@ -8,3 +8,5 @@ .last_* test test_* +tmp +var diff -Nru vim-tlib-1.20/LICENSE.TXT vim-tlib-1.23/LICENSE.TXT --- vim-tlib-1.20/LICENSE.TXT 1970-01-01 00:00:00.000000000 +0000 +++ vim-tlib-1.23/LICENSE.TXT 2017-03-16 19:32:34.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru vim-tlib-1.20/plugin/02tlib.vim vim-tlib-1.23/plugin/02tlib.vim --- vim-tlib-1.20/plugin/02tlib.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/plugin/02tlib.vim 2017-03-16 19:32:34.000000000 +0000 @@ -1,8 +1,8 @@ " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Created: 2007-04-10. -" @Last Change: 2016-01-26. +" @Last Change: 2017-02-22. " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 814 +" @Revision: 828 " @Website: http://www.vim.org/account/profile.php?user_id=4037 " GetLatestVimScripts: 1863 1 tlib.vim " tlib.vim -- Some utility functions @@ -14,7 +14,7 @@ echoerr "tlib requires Vim >= 7" finish endif -let g:loaded_tlib = 120 +let g:loaded_tlib = 123 let s:save_cpo = &cpo set cpo&vim @@ -88,10 +88,14 @@ command! -nargs=+ -bang Tlibtrace : -" :Tlibtraceset +RX1, -RX2... +" :Tlibtraceset[!] [--file=FILE] +RX1 -RX2... " If |tlib#trace#Enable()| was called: With the optional , users " can add and remove GUARDs (actually a |regexp|) that should be traced. -command! -nargs=+ -bang Tlibtraceset call tlib#trace#Set() +" +" If no `+` or `-` is prepended, assume `+`. +" +" With the optional bang '!', reset any options. +command! -nargs=+ -bang Tlibtraceset call tlib#trace#Set(tlib#arg#GetOpts([], {'short': 0}), !empty("")) " :display: :Tlibtrace ASSERTION diff -Nru vim-tlib-1.20/README vim-tlib-1.23/README --- vim-tlib-1.20/README 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/README 2017-03-16 19:32:34.000000000 +0000 @@ -13,8 +13,21 @@ ----------------------------------------------------------------------- +Install~ -Status: Works for me (there may be some minor quirks) +Edit the vba file and type: > + + :so % + +See :help vimball for details. If you have difficulties, please make +sure, you have the current version of vimball (vimscript #1502) +installed. + + + + + +License: GPLv3 or later Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT See http://github.com/tomtom for related plugins. diff -Nru vim-tlib-1.20/spec/tlib/date.vim vim-tlib-1.23/spec/tlib/date.vim --- vim-tlib-1.20/spec/tlib/date.vim 2016-01-26 17:04:08.000000000 +0000 +++ vim-tlib-1.23/spec/tlib/date.vim 2017-03-16 19:32:34.000000000 +0000 @@ -3,8 +3,8 @@ " @GIT: http://github.com/tomtom/vimtlib/ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2010-09-17. -" @Last Change: 2016-01-21. -" @Revision: 18 +" @Last Change: 2016-03-16. +" @Revision: 21 SpecBegin 'title': 'tlib#date' @@ -50,3 +50,12 @@ Should be equal tlib#date#Shift('2015-12-30', '2d'), '2016-01-01' Should be equal tlib#date#Shift('2015-12-30', '3d'), '2016-01-02' +Should be equal tlib#date#Shift('2016-03-16', '1b'), '2016-03-17' +Should be equal tlib#date#Shift('2016-03-16', '2b'), '2016-03-18' +Should be equal tlib#date#Shift('2016-03-16', '3b'), '2016-03-21' +Should be equal tlib#date#Shift('2016-03-16', '4b'), '2016-03-22' +Should be equal tlib#date#Shift('2016-03-16', '5b'), '2016-03-23' +Should be equal tlib#date#Shift('2016-03-16', '6b'), '2016-03-24' +Should be equal tlib#date#Shift('2016-03-16', '7b'), '2016-03-25' +Should be equal tlib#date#Shift('2016-03-16', '8b'), '2016-03-28' + diff -Nru vim-tlib-1.20/spec/tlib/dictionary.vim vim-tlib-1.23/spec/tlib/dictionary.vim --- vim-tlib-1.20/spec/tlib/dictionary.vim 1970-01-01 00:00:00.000000000 +0000 +++ vim-tlib-1.23/spec/tlib/dictionary.vim 2017-03-16 19:32:34.000000000 +0000 @@ -0,0 +1,28 @@ +" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) +" @Website: https://github.com/tomtom +" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) +" @Created: 2016-04-03. +" @Last Change: 2016-04-03. + +let s:save_cpo = &cpo +set cpo&vim + + + +SpecBegin 'title': 'tlib#dictionary' + + +It should handle basic test cases for tlib#dictionary#Rev properly. + +Should be equal tlib#dictionary#Rev({}), {} +Should be equal tlib#dictionary#Rev({1: 2, 3: 4}), {'2': '1', '4': '3'} +Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'empty': '*'}), {'*': '1', '4': '3'} +Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1}), {'''''': '1', '4': '3'} +Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1, 'use_eval': 1}), {'''''': 1, '4': 3} +Should be equal tlib#dictionary#Rev(tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1}), {'use_eval': 1}), {1: '', 3: 4} +Should be equal tlib#dictionary#Rev({1: 4, 2: 4}, {'values_as_list': 1}), {'4': ['1', '2']} +Should be equal tlib#dictionary#Rev({1: 4, 2: 4}, {'values_as_list': 1, 'use_eval': 1}), {'4': [1, 2]} + + +let &cpo = s:save_cpo +unlet s:save_cpo