diff options
Diffstat (limited to 'runtime/pack/dist')
-rw-r--r-- | runtime/pack/dist/opt/cfilter/plugin/cfilter.lua | 114 | ||||
-rw-r--r-- | runtime/pack/dist/opt/cfilter/plugin/cfilter.vim | 62 | ||||
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 39 | ||||
-rw-r--r-- | runtime/pack/dist/opt/vimball/doc/vimball.txt | 14 |
4 files changed, 146 insertions, 83 deletions
diff --git a/runtime/pack/dist/opt/cfilter/plugin/cfilter.lua b/runtime/pack/dist/opt/cfilter/plugin/cfilter.lua new file mode 100644 index 0000000000..20c158da65 --- /dev/null +++ b/runtime/pack/dist/opt/cfilter/plugin/cfilter.lua @@ -0,0 +1,114 @@ +---------------------------------------- +-- This file is generated via github.com/tjdevries/vim9jit +-- For any bugs, please first consider reporting there. +---------------------------------------- + +-- Ignore "value assigned to a local variable is unused" because +-- we can't guarantee that local variables will be used by plugins +-- luacheck: ignore 311 + +local vim9 = require('_vim9script') +local M = {} +local Qf_filter = nil +-- vim9script + +-- # cfilter.vim: Plugin to filter entries from a quickfix/location list +-- # Last Change: Jun 30, 2022 +-- # Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com) +-- # Version: 2.0 +-- # +-- # Commands to filter the quickfix list: +-- # :Cfilter[!] /{pat}/ +-- # Create a new quickfix list from entries matching {pat} in the current +-- # quickfix list. Both the file name and the text of the entries are +-- # matched against {pat}. If ! is supplied, then entries not matching +-- # {pat} are used. The pattern can be optionally enclosed using one of +-- # the following characters: ', ", /. If the pattern is empty, then the +-- # last used search pattern is used. +-- # :Lfilter[!] /{pat}/ +-- # Same as :Cfilter but operates on the current location list. +-- # + +Qf_filter = function(qf, searchpat, bang) + qf = vim9.bool(qf) + local Xgetlist = function() end + local Xsetlist = function() end + local cmd = '' + local firstchar = '' + local lastchar = '' + local pat = '' + local title = '' + local Cond = function() end + local items = {} + + if vim9.bool(qf) then + Xgetlist = function(...) + return vim.fn['getqflist'](...) + end + Xsetlist = function(...) + return vim.fn['setqflist'](...) + end + cmd = ':Cfilter' .. bang + else + Xgetlist = function(...) + return vim9.fn_ref(M, 'getloclist', vim.deepcopy({ 0 }), ...) + end + + Xsetlist = function(...) + return vim9.fn_ref(M, 'setloclist', vim.deepcopy({ 0 }), ...) + end + + cmd = ':Lfilter' .. bang + end + + firstchar = vim9.index(searchpat, 0) + lastchar = vim9.slice(searchpat, -1, nil) + if firstchar == lastchar and (firstchar == '/' or firstchar == '"' or firstchar == "'") then + pat = vim9.slice(searchpat, 1, -2) + if pat == '' then + -- # Use the last search pattern + pat = vim.fn.getreg('/') + end + else + pat = searchpat + end + + if pat == '' then + return + end + + if bang == '!' then + Cond = function(_, val) + return vim9.ops.NotRegexpMatches(val.text, pat) + and vim9.ops.NotRegexpMatches(vim9.fn.bufname(val.bufnr), pat) + end + else + Cond = function(_, val) + return vim9.ops.RegexpMatches(val.text, pat) + or vim9.ops.RegexpMatches(vim9.fn.bufname(val.bufnr), pat) + end + end + + items = vim9.fn_mut('filter', { Xgetlist(), Cond }, { replace = 0 }) + title = cmd .. ' /' .. pat .. '/' + Xsetlist({}, ' ', { ['title'] = title, ['items'] = items }) +end + +vim.api.nvim_create_user_command('Cfilter', function(__vim9_arg_1) + Qf_filter(true, __vim9_arg_1.args, (__vim9_arg_1.bang and '!' or '')) +end, { + bang = true, + nargs = '+', + complete = nil, +}) + +vim.api.nvim_create_user_command('Lfilter', function(__vim9_arg_1) + Qf_filter(false, __vim9_arg_1.args, (__vim9_arg_1.bang and '!' or '')) +end, { + bang = true, + nargs = '+', + complete = nil, +}) + +-- # vim: shiftwidth=2 sts=2 expandtab +return M diff --git a/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim b/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim deleted file mode 100644 index fe4455fe2e..0000000000 --- a/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim +++ /dev/null @@ -1,62 +0,0 @@ -" cfilter.vim: Plugin to filter entries from a quickfix/location list -" Last Change: Aug 23, 2018 -" Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com) -" Version: 1.1 -" -" Commands to filter the quickfix list: -" :Cfilter[!] /{pat}/ -" Create a new quickfix list from entries matching {pat} in the current -" quickfix list. Both the file name and the text of the entries are -" matched against {pat}. If ! is supplied, then entries not matching -" {pat} are used. The pattern can be optionally enclosed using one of -" the following characters: ', ", /. If the pattern is empty, then the -" last used search pattern is used. -" :Lfilter[!] /{pat}/ -" Same as :Cfilter but operates on the current location list. -" -if exists("loaded_cfilter") - finish -endif -let loaded_cfilter = 1 - -func s:Qf_filter(qf, searchpat, bang) - if a:qf - let Xgetlist = function('getqflist') - let Xsetlist = function('setqflist') - let cmd = ':Cfilter' . a:bang - else - let Xgetlist = function('getloclist', [0]) - let Xsetlist = function('setloclist', [0]) - let cmd = ':Lfilter' . a:bang - endif - - let firstchar = a:searchpat[0] - let lastchar = a:searchpat[-1:] - if firstchar == lastchar && - \ (firstchar == '/' || firstchar == '"' || firstchar == "'") - let pat = a:searchpat[1:-2] - if pat == '' - " Use the last search pattern - let pat = @/ - endif - else - let pat = a:searchpat - endif - - if pat == '' - return - endif - - if a:bang == '!' - let cond = 'v:val.text !~# pat && bufname(v:val.bufnr) !~# pat' - else - let cond = 'v:val.text =~# pat || bufname(v:val.bufnr) =~# pat' - endif - - let items = filter(Xgetlist(), cond) - let title = cmd . ' /' . pat . '/' - call Xsetlist([], ' ', {'title' : title, 'items' : items}) -endfunc - -com! -nargs=+ -bang Cfilter call s:Qf_filter(1, <q-args>, <q-bang>) -com! -nargs=+ -bang Lfilter call s:Qf_filter(0, <q-args>, <q-bang>) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 802ebd42b5..99fd7dba42 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2022 Jun 24 +" Last Change: 2022 Nov 10 " " WORK IN PROGRESS - The basics works stable, more to come " Note: In general you need at least GDB 7.12 because this provides the @@ -154,10 +154,16 @@ func s:StartDebug_internal(dict) let s:save_columns = 0 let s:allleft = 0 - if exists('g:termdebug_wide') - if &columns < g:termdebug_wide + let wide = 0 + if exists('g:termdebug_config') + let wide = get(g:termdebug_config, 'wide', 0) + elseif exists('g:termdebug_wide') + let wide = g:termdebug_wide + endif + if wide > 0 + if &columns < wide let s:save_columns = &columns - let &columns = g:termdebug_wide + let &columns = wide " If we make the Vim window wider, use the whole left half for the debug " windows. let s:allleft = 1 @@ -168,7 +174,12 @@ func s:StartDebug_internal(dict) endif " Override using a terminal window by setting g:termdebug_use_prompt to 1. - let use_prompt = exists('g:termdebug_use_prompt') && g:termdebug_use_prompt + let use_prompt = 0 + if exists('g:termdebug_config') + let use_prompt = get(g:termdebug_config, 'use_prompt', 0) + elseif exists('g:termdebug_use_prompt') + let use_prompt = g:termdebug_use_prompt + endif if !has('win32') && !use_prompt let s:way = 'terminal' else @@ -903,7 +914,14 @@ func s:InstallCommands() endif if has('menu') && &mouse != '' - call s:InstallWinbar() + " install the window toolbar by default, can be disabled in the config + let winbar = 1 + if exists('g:termdebug_config') + let winbar = get(g:termdebug_config, 'winbar', 1) + endif + if winbar + call s:InstallWinbar() + endif let popup = 1 if exists('g:termdebug_config') @@ -964,14 +982,7 @@ func s:DeleteCommands() nunmap K else " call mapset(s:k_map_saved) - let mode = s:k_map_saved.mode !=# ' ' ? s:k_map_saved.mode : '' - call nvim_set_keymap(mode, 'K', s:k_map_saved.rhs, { - \ 'expr': s:k_map_saved.expr ? v:true : v:false, - \ 'noremap': s:k_map_saved.noremap ? v:true : v:false, - \ 'nowait': s:k_map_saved.nowait ? v:true : v:false, - \ 'script': s:k_map_saved.script ? v:true : v:false, - \ 'silent': s:k_map_saved.silent ? v:true : v:false, - \ }) + call mapset('n', 0, s:k_map_saved) endif unlet s:k_map_saved endif diff --git a/runtime/pack/dist/opt/vimball/doc/vimball.txt b/runtime/pack/dist/opt/vimball/doc/vimball.txt index 9965a216e4..602fe85954 100644 --- a/runtime/pack/dist/opt/vimball/doc/vimball.txt +++ b/runtime/pack/dist/opt/vimball/doc/vimball.txt @@ -88,7 +88,7 @@ MAKING A VIMBALL *:MkVimball* If you wish to force slashes into the filename, that can also be done by using the exclamation mark (ie. :MkVimball! path/filename). - The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 + The tip at https://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 has a good idea on how to automate the production of vimballs using make. @@ -171,12 +171,12 @@ WINDOWS *vimball-windows* > Item Tool/Suite Free Website ---- ---------- ---- ------- - 7zip tool y http://www.7-zip.org/ - Winzip tool n http://www.winzip.com/downwz.htm - unxutils suite y http://unxutils.sourceforge.net/ - cygwin suite y http://www.cygwin.com/ - GnuWin32 suite y http://gnuwin32.sourceforge.net/ - MinGW suite y http://www.mingw.org/ + 7zip tool y https://www.7-zip.org/ + Winzip tool n https://www.winzip.com/downwz.htm + unxutils suite y https://unxutils.sourceforge.net/ + cygwin suite y https://www.cygwin.com/ + GnuWin32 suite y https://gnuwin32.sourceforge.net/ + MinGW suite y https://www.mingw.org/ < ============================================================================== |