From 144279ef30a432ac8416746e3491f3120ae9b4e8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 3 Feb 2023 09:18:18 +0100 Subject: vim-patch:be4e01637e71 (#22103) Update runtime files. https://github.com/vim/vim/commit/be4e01637e71c8d5095c33b9861fd70b41476732 Co-authored-by: Bram Moolenaar --- runtime/plugin/tohtml.vim | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim index 08df19b4f9..0369313f08 100644 --- a/runtime/plugin/tohtml.vim +++ b/runtime/plugin/tohtml.vim @@ -1,6 +1,6 @@ " Vim plugin for converting a syntax highlighted file to HTML. " Maintainer: Ben Fritz -" Last Change: 2019 Nov 13 +" Last Change: 2023 Jan 01 " " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and " $VIMRUNTIME/syntax/2html.vim @@ -8,11 +8,23 @@ if exists('g:loaded_2html_plugin') finish endif -let g:loaded_2html_plugin = 'vim8.1_v2' +let g:loaded_2html_plugin = 'vim9.0_v1' " " Changelog: {{{ -" 8.1_v2 (this version): - Fix Bitbucket issue #19: fix calculation of tab +" 9.0_v1 (this version): - Implement g:html_no_doc and g:html_no_modeline +" for diff mode. Add tests. +" (Vim 9.0.1122): NOTE: no version string update for this version! +" - Bugfix for variable name in g:html_no_doc +" (Vim 9.0.0819): NOTE: no version string update for this version! +" - Add options g:html_no_doc, g:html_no_lines, +" and g:html_no_modeline (partially included in Vim +" runtime prior to version string update). +" - Updates for new Vim9 string append style (i.e. use +" ".." instead of ".") +" +" 8.1 updates: {{{ +" 8.1_v2 (Vim 8.1.2312): - Fix SourceForge issue #19: fix calculation of tab " stop position to use in expanding a tab, when that " tab occurs after a syntax match which in turn " comes after previously expanded tabs. @@ -20,17 +32,17 @@ let g:loaded_2html_plugin = 'vim8.1_v2' " destination file to ignore FileType events; " speeds up processing when the destination file " already exists and HTML highlight takes too long. -" - Fix Bitbucket issue #20: progress bar could not be +" - Fix SourceForge issue #20: progress bar could not be " seen when DiffDelete background color matched " StatusLine background color. Added TOhtmlProgress " highlight group for manual user override, but " calculate it to be visible compared to StatusLine " by default. -" - Fix Bitbucket issue #1: Remove workaround for old +" - Fix SourceForge issue #1: Remove workaround for old " browsers which don't support 'ch' CSS unit, since " all modern browsers, including IE>=9, support it. -" - Fix Bitbucket issue #10: support termguicolors -" - Fix Bitbucket issue #21: default to using +" - Fix SourceForge issue #10: support termguicolors +" - Fix SourceForge issue #21: default to using " generated content instead of tags for " uncopyable text, so that text is correctly " prevented from being copied in chrome. Use @@ -41,13 +53,14 @@ let g:loaded_2html_plugin = 'vim8.1_v2' " - Fix fallback sizing of tags for browsers " without "ch" support. " - Fix cursor on unselectable diff filler text. -" 8.1_v1 (Vim 8.1.0528): - Fix Bitbucket issue #6: Don't generate empty +" 8.1_v1 (Vim 8.1.0528): - Fix SourceForge issue #6: Don't generate empty " script tag. -" - Fix Bitbucket issue #5: javascript should +" - Fix SourceForge issue #5: javascript should " declare variables with "var". -" - Fix Bitbucket issue #13: errors thrown sourcing +" - Fix SourceForge issue #13: errors thrown sourcing " 2html.vim directly when plugins not loaded. -" - Fix Bitbucket issue #16: support 'vartabstop'. +" - Fix SourceForge issue #16: support 'vartabstop'. +"}}} " " 7.4 updates: {{{ " 7.4_v2 (Vim 7.4.0899): Fix error raised when converting a diff containing @@ -152,7 +165,7 @@ let g:loaded_2html_plugin = 'vim8.1_v2' " TODO: {{{ " * Check the issue tracker: -" https://bitbucket.org/fritzophrenic/vim-tohtml/issues?status=new&status=open +" https://sourceforge.net/p/vim-tohtml/issues/search/?q=%21status%3Aclosed " * Options for generating the CSS in external style sheets. New :TOcss " command to convert the current color scheme into a (mostly) generic CSS " stylesheet which can be re-used. Alternate stylesheet support? Good start -- cgit From 66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 28 Feb 2023 09:34:27 +0100 Subject: vim-patch:partial:dd60c365cd26 (#22437) vim-patch:partial:dd60c365cd26 Update runtime files https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97 Co-authored-by: Bram Moolenaar Skip: eval.txt, repeat.txt (needs `getscriptinfo()`) --- runtime/plugin/matchparen.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 3982489b92..e19b283228 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -108,8 +108,9 @@ func s:Highlight_Matching_Pair() " searchpairpos()'s skip argument. " We match "escape" for special items, such as lispEscapeSpecial, and " match "symbol" for lispBarSymbol. - let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . - \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|symbol\\|comment"''))' + let s_skip = 'synstack(".", col("."))' + \ . '->indexof({_, id -> synIDattr(id, "name") =~? ' + \ . '"string\\|character\\|singlequote\\|escape\\|symbol\\|comment"}) >= 0' " If executing the expression determines that the cursor is currently in " one of the syntax types, then we want searchpairpos() to find the pair " within those syntax types (i.e., not skip). Otherwise, the cursor is -- cgit From f449121764c19cebda7b8b2c970b76bc8121bae7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 2 Mar 2023 18:03:11 +0100 Subject: feat(treesitter): add :InspectTree command (#22477) --- runtime/plugin/nvim.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 815886f896..762e9519db 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -5,3 +5,7 @@ vim.api.nvim_create_user_command('Inspect', function(cmd) vim.show_pos() end end, { desc = 'Inspect highlights and extmarks at the cursor', bang = true }) + +vim.api.nvim_create_user_command('InspectTree', function() + vim.treesitter.inspect_tree() +end, { desc = 'Inspect treesitter language tree for buffer' }) -- cgit From 673d2b52fa4335aa083c52e6686f0728e25b8ebd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 7 Mar 2023 16:04:57 +0100 Subject: refactor!: rename vim.pretty_print => vim.print Problem: The function name `vim.pretty_print`: 1. is verbose, which partially defeats its purpose as sugar 2. does not draw from existing precedent or any sort of convention (except external projects like penlight or python?), which reduces discoverability, and degrades signaling about best practices. Solution: - Rename to `vim.print`. - Change the behavior so that 1. strings are printed without quotes 2. each arg is printed on its own line 3. tables are indented with 2 instead of 4 spaces - Example: :lua ='a', 'b', 42, {a=3} a b 42 { a = 3 } Comparison of alternatives: - `vim.print`: - pro: consistent with Lua's `print()` - pro: aligns with potential `nvim_print` API function which will replace nvim_echo, nvim_notify, etc. - con: behaves differently than Lua's `print()`, slightly misleading? - `vim.echo`: - pro: `:echo` has similar "pretty print" behavior. - con: inconsistent with Lua idioms. - `vim.p`: - pro: very short, fits with `vim.o`, etc. - con: not as discoverable as "echo" - con: less opportunity for `local p = vim.p` because of potential shadowing. --- runtime/plugin/nvim.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 762e9519db..e4b099f7ad 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -1,6 +1,6 @@ vim.api.nvim_create_user_command('Inspect', function(cmd) if cmd.bang then - vim.pretty_print(vim.inspect_pos()) + vim.print(vim.inspect_pos()) else vim.show_pos() end -- cgit From 2720d2c793b22e6c0c8719e5592922619fffdf7a Mon Sep 17 00:00:00 2001 From: Yochem van Rosmalen Date: Fri, 17 Mar 2023 12:41:57 +0100 Subject: fix(treesitter): InspectTree does not respect 'splitright' #22692 Problem: vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'. Solution: - Change the default `command` from `topleft 60vnew` to `60vnew`. - Change :InspectTree to respect command mods (`:vertical`, count, etc.). Closes #22656 --- runtime/plugin/nvim.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index e4b099f7ad..0a33826b82 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -6,6 +6,15 @@ vim.api.nvim_create_user_command('Inspect', function(cmd) end end, { desc = 'Inspect highlights and extmarks at the cursor', bang = true }) -vim.api.nvim_create_user_command('InspectTree', function() - vim.treesitter.inspect_tree() -end, { desc = 'Inspect treesitter language tree for buffer' }) +vim.api.nvim_create_user_command('InspectTree', function(cmd) + if cmd.mods ~= '' or cmd.count ~= 0 then + local count = cmd.count ~= 0 and cmd.count or '' + local new = cmd.mods ~= '' and 'new' or 'vnew' + + vim.treesitter.inspect_tree({ + command = ('%s %s%s'):format(cmd.mods, count, new), + }) + else + vim.treesitter.inspect_tree() + end +end, { desc = 'Inspect treesitter language tree for buffer', count = true }) -- cgit From d675bd01b1e78b93e559320b262bdae40b3b54b2 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Fri, 7 Apr 2023 08:22:47 -0600 Subject: feat(lua): allow vim.F.if_nil to take multiple arguments (#22903) The first argument which is non-nil is returned. This is useful when using nested default values (e.g. in the EditorConfig plugin). Before: local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) After: local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true) --- runtime/plugin/editorconfig.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index 54cd0e828e..a96919e1fe 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -3,7 +3,7 @@ vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, { group = group, callback = function(args) -- Buffer-local enable has higher priority - local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) + local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true) if not enable then return end -- cgit From 880f7d12fea31ea85d14b419ef8dcbb16dee2cf4 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 11 Apr 2023 19:10:36 +0200 Subject: feat!: remove vimballs (#22402) Vimball is an outdated feature that is rarely used these days. It is not a maintenance burden on its own, but it is nonetheless dead weight and something we'd need to tell users to ignore when they inevitably ask what it is. See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173 --- runtime/plugin/tarPlugin.vim | 1 - 1 file changed, 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim index d55492a93e..384a3ed823 100644 --- a/runtime/plugin/tarPlugin.vim +++ b/runtime/plugin/tarPlugin.vim @@ -47,7 +47,6 @@ augroup tar au BufReadCmd *.tar.zst call tar#Browse(expand("")) au BufReadCmd *.tzs call tar#Browse(expand("")) augroup END -com! -nargs=? -complete=file Vimuntar call tar#Vimuntar() " --------------------------------------------------------------------- " Restoration And Modelines: {{{1 -- cgit From 2b35de386ee8854e1012feb4a6cc53b099220677 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 12 Apr 2023 00:01:34 +0200 Subject: refactor: remove :CheckHealth Using :CheckHealth invokes an error, and many of the features from :checkhealth doesn't even work such as calling only a specific check. Users should use :checkhealth instead. --- runtime/plugin/health.vim | 1 - 1 file changed, 1 deletion(-) delete mode 100644 runtime/plugin/health.vim (limited to 'runtime/plugin') diff --git a/runtime/plugin/health.vim b/runtime/plugin/health.vim deleted file mode 100644 index 66ae8fb239..0000000000 --- a/runtime/plugin/health.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd CmdUndefined CheckHealth checkhealth -- cgit From e3f36377c156749bbdafc46d8a8cd017f378b4b5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 23 Apr 2023 15:22:55 +0200 Subject: vim-patch:71badf9547e8 (#23285) Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar --- runtime/plugin/netrwPlugin.vim | 2 +- runtime/plugin/zipPlugin.vim | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index d309f81484..431d9ad9c4 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v171" +let g:loaded_netrwPlugin = "v172" let s:keepcpo = &cpo set cpo&vim "DechoRemOn diff --git a/runtime/plugin/zipPlugin.vim b/runtime/plugin/zipPlugin.vim index edc52713a8..c3118a361d 100644 --- a/runtime/plugin/zipPlugin.vim +++ b/runtime/plugin/zipPlugin.vim @@ -1,6 +1,6 @@ " zipPlugin.vim: Handles browsing zipfiles " PLUGIN PORTION -" Date: Jan 07, 2020 +" Date: Dec 07, 2021 " Maintainer: Charles E Campbell " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1 @@ -20,14 +20,14 @@ if &cp || exists("g:loaded_zipPlugin") finish endif -let g:loaded_zipPlugin = "v32" +let g:loaded_zipPlugin = "v33" let s:keepcpo = &cpo set cpo&vim " --------------------------------------------------------------------- " Options: {{{1 if !exists("g:zipPlugin_ext") - let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' + let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' endif " --------------------------------------------------------------------- -- cgit From c11986ed1a816d7ebcb5a5f707e3ef884f278293 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 15 May 2023 09:38:32 +0200 Subject: vim-patch:b7398fe41c9e (#23627) Update runtime files https://github.com/vim/vim/commit/b7398fe41c9e1e731d058105a34158871ee83e3f Co-authored-by: Bram Moolenaar --- runtime/plugin/netrwPlugin.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index 431d9ad9c4..a347781e6f 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v172" +let g:loaded_netrwPlugin = "v173" let s:keepcpo = &cpo set cpo&vim "DechoRemOn -- cgit From af6e6ccf3dee815850639ec5613dda3442caa7d6 Mon Sep 17 00:00:00 2001 From: marshmallow Date: Sun, 30 Apr 2023 15:53:02 +1000 Subject: feat(vim.ui): vim.ui.open, "gx" without netrw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mathias Fußenegger Co-authored-by: Justin M. Keyes Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com> --- runtime/plugin/nvim.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 0a33826b82..fcc1b016aa 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -18,3 +18,11 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) vim.treesitter.inspect_tree() end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) + +if vim.g.use_lua_gx == nil or vim.g.use_lua_gx == true then + vim.keymap.set({ 'n', 'x' }, 'gx', function() + local uri = vim.fn.expand('') + + vim.ui.open(uri) + end, { desc = 'Open URI under cursor with system app' }) +end -- cgit From 67b2ed1004ae551c9fe1bbd29a86b5a301570800 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2023 16:51:30 +0200 Subject: fix(gx): visual selection, expand env vars --- Rejected experiment: move vim.ui.open() to vim.env.open() Problem: `vim.ui` is where user-interface "providers" live, which can be overridden. It would also be useful to have a "providers" namespace for platform-specific features such as "open", clipboard, python, and the other providers listed in `:help providers`. We could overload `vim.ui` to serve that purpose as the single "providers" namespace, but `vim.ui.nodejs()` for example seems awkward. Solution: `vim.env` currently has too narrow of a purpose. Overload it to also be a namespace for `vim.env.open`. diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua index 913f1fe20348..17d05ff37595 100644 --- a/runtime/lua/vim/_meta.lua +++ b/runtime/lua/vim/_meta.lua @@ -37,8 +37,28 @@ local options_info = setmetatable({}, { end, }) -vim.env = setmetatable({}, { - __index = function(_, k) +vim.env = setmetatable({ + open = setmetatable({}, { + __call = function(_, uri) + print('xxxxx'..uri) + return true + end, + __tostring = function() + local v = vim.fn.getenv('open') + if v == vim.NIL then + return nil + end + return v + end, + }) + }, + { + __index = function(t, k, ...) + if k == 'open' then + error() + -- vim.print({...}) + -- return rawget(t, k) + end local v = vim.fn.getenv(k) if v == vim.NIL then return nil --- runtime/plugin/nvim.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index fcc1b016aa..9fff6246e3 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -19,10 +19,15 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) -if vim.g.use_lua_gx == nil or vim.g.use_lua_gx == true then - vim.keymap.set({ 'n', 'x' }, 'gx', function() - local uri = vim.fn.expand('') - - vim.ui.open(uri) - end, { desc = 'Open URI under cursor with system app' }) +-- TODO: use vim.region() when it lands... #13896 #16843 +local function get_visual_selection() + local save_a = vim.fn.getreginfo('a') + vim.cmd[[norm! "ay]] + local selection = vim.fn.getreg('a', 1) + vim.fn.setreg('a', save_a) + return selection end + +local gx_desc = 'Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)' +vim.keymap.set({ 'n' }, 'gx', function() vim.ui.open(vim.fn.expand('')) end, { desc = gx_desc }) +vim.keymap.set({ 'x' }, 'gx', function() vim.ui.open(get_visual_selection()) end, { desc = gx_desc }) -- cgit From e644e7ce0b36dd5e75770f3faa0a84f15e2561e8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 4 Jul 2023 23:33:23 +0200 Subject: fix(vim.ui.open): return (don't show) error message Problem: Showing an error via vim.notify() makes it awkward for callers such as lsp/handlers.lua to avoid showing redundant errors. Solution: Return the message instead of showing it. Let the caller decide whether and when to show the message. --- runtime/plugin/nvim.lua | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 9fff6246e3..33d399e577 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -22,12 +22,23 @@ end, { desc = 'Inspect treesitter language tree for buffer', count = true }) -- TODO: use vim.region() when it lands... #13896 #16843 local function get_visual_selection() local save_a = vim.fn.getreginfo('a') - vim.cmd[[norm! "ay]] + vim.cmd([[norm! "ay]]) local selection = vim.fn.getreg('a', 1) vim.fn.setreg('a', save_a) return selection end -local gx_desc = 'Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)' -vim.keymap.set({ 'n' }, 'gx', function() vim.ui.open(vim.fn.expand('')) end, { desc = gx_desc }) -vim.keymap.set({ 'x' }, 'gx', function() vim.ui.open(get_visual_selection()) end, { desc = gx_desc }) +local gx_desc = + 'Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)' +local function do_open(uri) + local _, err = vim.ui.open(uri) + if err then + vim.notify(err, vim.log.levels.ERROR) + end +end +vim.keymap.set({ 'n' }, 'gx', function() + do_open(vim.fn.expand('')) +end, { desc = gx_desc }) +vim.keymap.set({ 'x' }, 'gx', function() + do_open(get_visual_selection()) +end, { desc = gx_desc }) -- cgit From df297e3c2bd743616371db73467a3f08d2b96d9b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 5 Jul 2023 16:31:45 +0800 Subject: fix(runtime): don't set gx mapping if already mapped (#24262) This matches netrw's use of maparg(). --- runtime/plugin/nvim.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 33d399e577..e3d4625c3b 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -36,9 +36,13 @@ local function do_open(uri) vim.notify(err, vim.log.levels.ERROR) end end -vim.keymap.set({ 'n' }, 'gx', function() - do_open(vim.fn.expand('')) -end, { desc = gx_desc }) -vim.keymap.set({ 'x' }, 'gx', function() - do_open(get_visual_selection()) -end, { desc = gx_desc }) +if vim.fn.maparg('gx', 'n') == '' then + vim.keymap.set({ 'n' }, 'gx', function() + do_open(vim.fn.expand('')) + end, { desc = gx_desc }) +end +if vim.fn.maparg('gx', 'x') == '' then + vim.keymap.set({ 'x' }, 'gx', function() + do_open(get_visual_selection()) + end, { desc = gx_desc }) +end -- cgit From 6a486c44e66f05ae11137ad7a192b89989192566 Mon Sep 17 00:00:00 2001 From: marshmallow Date: Tue, 25 Jul 2023 01:35:19 +1000 Subject: fix(gx): move to to _init_default_mappings #24420 Problem: netrw may conflict with the Nvim default "gx" mapping. Solution: Initialize keymapping earlier by moving it to vim._init_default_mappings(). That also avoids needing to check maparg(). --- runtime/plugin/nvim.lua | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index e3d4625c3b..0a33826b82 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -18,31 +18,3 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) vim.treesitter.inspect_tree() end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) - --- TODO: use vim.region() when it lands... #13896 #16843 -local function get_visual_selection() - local save_a = vim.fn.getreginfo('a') - vim.cmd([[norm! "ay]]) - local selection = vim.fn.getreg('a', 1) - vim.fn.setreg('a', save_a) - return selection -end - -local gx_desc = - 'Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)' -local function do_open(uri) - local _, err = vim.ui.open(uri) - if err then - vim.notify(err, vim.log.levels.ERROR) - end -end -if vim.fn.maparg('gx', 'n') == '' then - vim.keymap.set({ 'n' }, 'gx', function() - do_open(vim.fn.expand('')) - end, { desc = gx_desc }) -end -if vim.fn.maparg('gx', 'x') == '' then - vim.keymap.set({ 'x' }, 'gx', function() - do_open(get_visual_selection()) - end, { desc = gx_desc }) -end -- cgit From cbf54ec2a5aaa1a00ff89e26bab44a30d09d4631 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 13 Aug 2023 13:25:10 +0100 Subject: vim-patch:e978b4534a5e (#24697) Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749) https://github.com/vim/vim/commit/e978b4534a5e10471108259118c0ef791106fd92 Also update the header for the following files that were converted to Vim9 script upstream: - autoload/ccomplete.lua (vim9jitted) - ftplugin.vim - ftplugof.vim - indent.vim - indent/vim.vim - makemenu.vim This also updates the "Last Change" dates, even if some changes (due to rewrites to Vim9 script) were not ported. There's still a few other places where Bram is still mentioned as a maintainer in the files we and Vim have: - ftplugin/bash.vim - indent/bash.vim - indent/html.vim - indent/mail.vim - macros/accents.vim - macros/editexisting.vim - syntax/bash.vim - syntax/shared/typescriptcommon.vim - syntax/tar.vim - syntax/typescript.vim - syntax/typescriptreact.vim - syntax/zimbu.vim Maybe future patches will address that. Also exclude changes to .po files that didn't apply automatically (the `:messages` maintainer string isn't used in Nvim anyway). Co-authored-by: Christian Brabandt --- runtime/plugin/gzip.vim | 5 +++-- runtime/plugin/matchparen.vim | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/gzip.vim b/runtime/plugin/gzip.vim index 7214488579..c02bd99567 100644 --- a/runtime/plugin/gzip.vim +++ b/runtime/plugin/gzip.vim @@ -1,6 +1,7 @@ " Vim plugin for editing compressed files. -" Maintainer: Bram Moolenaar -" Last Change: 2016 Oct 30 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Exit quickly when: " - this plugin was already loaded diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index e19b283228..b33ecd557c 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,7 @@ " Vim plugin for showing matching parens -" Maintainer: Bram Moolenaar -" Last Change: 2022 Dec 01 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Exit quickly when: " - this plugin was already loaded (or disabled) -- cgit From 5d8ab32f3871b0232972cac1116ac7cba98389e5 Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Fri, 25 Aug 2023 11:17:36 -0700 Subject: feat(treesitter): add a query editor (#24703) --- runtime/plugin/nvim.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 0a33826b82..2ddccfcff6 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -18,3 +18,7 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) vim.treesitter.inspect_tree() end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) + +vim.api.nvim_create_user_command('PreviewQuery', function() + vim.treesitter.preview_query() +end, { desc = 'Preview treesitter query' }) -- cgit From 294ded9cf26a1a1cab9071588e41bb3ce9474f18 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 8 Sep 2023 23:35:18 +0200 Subject: vim-patch:86cfb39030eb runtime(tohtml): Update TOhtml to version 9.0v2 (vim/vim#13050) Modified behavior: - Change default value of g:html_use_input_for_pc from "fallback" to "none". This means with default settings, only the standards-based method to make special text unselectable is used. The old method relying on unspecified browser behavior for tags is now only used if a user specifically enables it. - Officially deprecate g:use_xhtml option (in favor of g:html_use_xhtml) by issuing a warning message when used. Bugfixes: - Fix issue vim/vim#8547: LineNr and other special highlight groups did not get proper style rules defined when using "hi link". - Fix that diff filler was not properly added for deleted lines at the end of a buffer. Other: - Refactored function definitions from long lists of strings to use :let-heredoc variable assignment instead. - Corrected deprecated "." string concatenation operator to ".." operator in more places. https://github.com/vim/vim/commit/86cfb39030eb557e1a1c7804f9c147556ca5dbf1 Co-authored-by: fritzophrenic --- runtime/plugin/tohtml.vim | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim index 0369313f08..56eb2c15bf 100644 --- a/runtime/plugin/tohtml.vim +++ b/runtime/plugin/tohtml.vim @@ -1,6 +1,6 @@ " Vim plugin for converting a syntax highlighted file to HTML. " Maintainer: Ben Fritz -" Last Change: 2023 Jan 01 +" Last Change: 2023 Sep 07 " " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and " $VIMRUNTIME/syntax/2html.vim @@ -8,11 +8,29 @@ if exists('g:loaded_2html_plugin') finish endif -let g:loaded_2html_plugin = 'vim9.0_v1' +let g:loaded_2html_plugin = 'vim9.0_v2' " " Changelog: {{{ -" 9.0_v1 (this version): - Implement g:html_no_doc and g:html_no_modeline +" 9.0_v2 (this version): - Warn if using deprecated g:use_xhtml option +" - Change default g:html_use_input_for_pc to "none" +" instead of "fallback". All modern browsers support +" the "user-select: none" and "content:" CSS +" properties so the older method relying on extra +" markup and unspecified browser/app clipboard +" handling is only needed in rare special cases. +" - Fix SourceForge issue #33: generate diff filler +" correctly when new lines have been added to or +" removed from end of buffer. +" - Fix SourceForge issue #32/Vim Github issue #8547: +" use translated highlight ID for styling the +" special-use group names (e.g. LineNr) used +" directly by name in the 2html processing. +" - Fix SourceForge issue #26, refactoring to use +" :let-heredoc style string assignment and +" additional fixes for ".." vs. "." style string +" concatenation. Requires Vim v8.1.1354 or higher. +" 9.0_v1 (Vim 9.0.1275): - Implement g:html_no_doc and g:html_no_modeline " for diff mode. Add tests. " (Vim 9.0.1122): NOTE: no version string update for this version! " - Bugfix for variable name in g:html_no_doc @@ -21,7 +39,8 @@ let g:loaded_2html_plugin = 'vim9.0_v1' " and g:html_no_modeline (partially included in Vim " runtime prior to version string update). " - Updates for new Vim9 string append style (i.e. use -" ".." instead of ".") +" ".." instead of "."). Requires Vim version +" 8.1.1114 or higher. " " 8.1 updates: {{{ " 8.1_v2 (Vim 8.1.2312): - Fix SourceForge issue #19: fix calculation of tab -- cgit From 28233bcb49067aaa70fa6e5fec14e2cc4bcaa315 Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Fri, 15 Sep 2023 03:10:55 -0700 Subject: refactor(treesitter): rename "preview" => "edit" #25161 "Edit" more closely describes the generic application than "Preview", though the buffer contents don't (yet) map to an actual file on disk. https://github.com/neovim/neovim/pull/24703#discussion_r1321719133 --- runtime/plugin/nvim.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 2ddccfcff6..13a54a5e20 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -19,6 +19,6 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) -vim.api.nvim_create_user_command('PreviewQuery', function() - vim.treesitter.preview_query() -end, { desc = 'Preview treesitter query' }) +vim.api.nvim_create_user_command('EditQuery', function() + vim.treesitter.query.edit() +end, { desc = 'Edit treesitter query' }) -- cgit From 28f54a78782318cb9c356a372b9e52a3a6b1f8dd Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Sat, 16 Sep 2023 10:05:59 -0700 Subject: feat(treesitter): add lang parameter to the query editor (#25181) --- runtime/plugin/nvim.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua index 13a54a5e20..743d3044b6 100644 --- a/runtime/plugin/nvim.lua +++ b/runtime/plugin/nvim.lua @@ -19,6 +19,6 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd) end end, { desc = 'Inspect treesitter language tree for buffer', count = true }) -vim.api.nvim_create_user_command('EditQuery', function() - vim.treesitter.query.edit() -end, { desc = 'Edit treesitter query' }) +vim.api.nvim_create_user_command('EditQuery', function(cmd) + vim.treesitter.query.edit(cmd.fargs[1]) +end, { desc = 'Edit treesitter query', nargs = '?' }) -- cgit From fc02908c97fa850964a1f15a32eb7a872449b7e7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 21 Oct 2023 18:04:08 +0800 Subject: vim-patch:d3e277f279ed (#25734) matchparen: do not use hard-coded match id (vim/vim#13393) * matchparen: do not use hard-coded match id Instead of using the hard-coded match id 3, which may also be used by other plugins, let the matchparen plugin use whatever ids are automatically returned when calling matchaddpos(). For backwards-compatibility, keep the `:3match` call, which will still use the hard-coded id 3 (as mentioned in :h :3match). closes: vim/vim#13381 https://github.com/vim/vim/commit/d3e277f279ed628809eb6857ea3ebcfca566ca2a Co-authored-by: Christian Brabandt --- runtime/plugin/matchparen.vim | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index b33ecd557c..9d57545ee8 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Last Change: 2023 Oct 20 " Former Maintainer: Bram Moolenaar " Exit quickly when: @@ -18,6 +18,8 @@ if !exists("g:matchparen_insert_timeout") let g:matchparen_insert_timeout = 60 endif +let s:has_matchaddpos = exists('*matchaddpos') + augroup matchparen " Replace all matchparen autocommands autocmd! CursorMoved,CursorMovedI,WinEnter,BufWinEnter,WinScrolled * call s:Highlight_Matching_Pair() @@ -38,6 +40,9 @@ set cpo-=C " The function that is invoked (very often) to define a ":match" highlighting " for any matching paren. func s:Highlight_Matching_Pair() + if !exists("w:matchparen_ids") + let w:matchparen_ids = [] + endif " Remove any previous match. call s:Remove_Matches() @@ -185,11 +190,12 @@ func s:Highlight_Matching_Pair() " If a match is found setup match highlighting. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom - if exists('*matchaddpos') - call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) + if s:has_matchaddpos + call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10)) else exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + call add(w:matchparen_ids, 3) endif let w:paren_hl_on = 1 endif @@ -197,12 +203,13 @@ endfunction func s:Remove_Matches() if exists('w:paren_hl_on') && w:paren_hl_on - silent! call matchdelete(3) + while !empty(w:matchparen_ids) + silent! call remove(w:matchparen_ids, 0)->matchdelete() + endwhile let w:paren_hl_on = 0 endif endfunc - " Define commands that will disable and enable the plugin. command DoMatchParen call s:DoMatchParen() command NoMatchParen call s:NoMatchParen() -- cgit From 6f936c9d85a056919f53486c38fcf541466416cc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 7 Nov 2023 10:39:27 +0800 Subject: fix(man): make :Man with a range work (#25922) --- runtime/plugin/man.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.lua b/runtime/plugin/man.lua index 4b1528b0cb..50a48fe7f2 100644 --- a/runtime/plugin/man.lua +++ b/runtime/plugin/man.lua @@ -16,6 +16,7 @@ vim.api.nvim_create_user_command('Man', function(params) end, { bang = true, bar = true, + range = true, addr = 'other', nargs = '*', complete = function(...) -- cgit From 2a58aa57098a4876afa8d865d6d9ec32407d7f11 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 13 Nov 2023 10:47:12 +0800 Subject: vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019) Problem: matchparen highlight not cleared in completion mode Solution: Clear matchparen highlighting in completion mode Remove hard-coded hack in insexpand.c to clear the :3match before displaying the completion menu. Add a test for matchparen highlighting. While at it, move all test tests related to the matchparen plugin into a separate test file. closes: vim/vim#13493 closes: vim/vim#13524 https://github.com/vim/vim/commit/9588666360e94de3ff58d4bc79aa9148fbf5fc44 Co-authored-by: Christian Brabandt --- runtime/plugin/matchparen.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 9d57545ee8..4235a0d39b 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -26,6 +26,7 @@ augroup matchparen autocmd! WinLeave,BufLeave * call s:Remove_Matches() if exists('##TextChanged') autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() + autocmd! TextChangedP * call s:Remove_Matches() endif augroup END -- cgit From db57df04b6af03ad9dd0447ffc8e881c97a39732 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:21:24 -0600 Subject: feat(clipboard): enable OSC 52 clipboard provider by default (#26064) Use the XTGETTCAP sequence to determine if the host terminal supports the OSC 52 sequence and, if it does, enable the OSC 52 clipboard provider by default. This is only done automatically when all of the following are true: 1. Nvim is running in the TUI 2. 'clipboard' is not set to unnamed or unnamedplus 3. g:clipboard is unset 4. Nvim is running in an SSH connection ($SSH_TTY is set) 5. Nvim is not running inside tmux ($TMUX is unset) --- runtime/plugin/osc52.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 runtime/plugin/osc52.lua (limited to 'runtime/plugin') diff --git a/runtime/plugin/osc52.lua b/runtime/plugin/osc52.lua new file mode 100644 index 0000000000..78b21863ad --- /dev/null +++ b/runtime/plugin/osc52.lua @@ -0,0 +1,37 @@ +local tty = vim.iter(vim.api.nvim_list_uis()):any(function(ui) + return ui.chan == 1 and ui.stdout_tty +end) + +if + not tty + or vim.g.clipboard ~= nil + or vim.o.clipboard ~= '' + or not os.getenv('SSH_TTY') + or os.getenv('TMUX') +then + return +end + +require('vim.termcap').query('Ms', function(cap, seq) + assert(cap == 'Ms') + + -- If the terminal reports a sequence other than OSC 52 for the Ms capability + -- then ignore it. We only support OSC 52 (for now) + if not seq:match('^\027%]52') then + return + end + + local osc52 = require('vim.ui.clipboard.osc52') + + vim.g.clipboard = { + name = 'OSC 52', + copy = { + ['+'] = osc52.copy('+'), + ['*'] = osc52.copy('*'), + }, + paste = { + ['+'] = osc52.paste('+'), + ['*'] = osc52.paste('*'), + }, + } +end) -- cgit From 5d75d9aef2b69036328501820df770b29d57a308 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 16 Nov 2023 13:56:05 -0600 Subject: fix(osc52): enable OSC 52 by default in tmux sessions (#26072) tmux has a set-clipboard option which, when set to 'on', allows applications to set the system clipboard using the usual OSC 52 escape sequence. --- runtime/plugin/osc52.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/osc52.lua b/runtime/plugin/osc52.lua index 78b21863ad..374b70066f 100644 --- a/runtime/plugin/osc52.lua +++ b/runtime/plugin/osc52.lua @@ -2,19 +2,18 @@ local tty = vim.iter(vim.api.nvim_list_uis()):any(function(ui) return ui.chan == 1 and ui.stdout_tty end) -if - not tty - or vim.g.clipboard ~= nil - or vim.o.clipboard ~= '' - or not os.getenv('SSH_TTY') - or os.getenv('TMUX') -then +if not tty or vim.g.clipboard ~= nil or vim.o.clipboard ~= '' or not os.getenv('SSH_TTY') then return end require('vim.termcap').query('Ms', function(cap, seq) assert(cap == 'Ms') + -- Check 'clipboard' and g:clipboard again to avoid a race condition + if vim.o.clipboard ~= '' or vim.g.clipboard ~= nil then + return + end + -- If the terminal reports a sequence other than OSC 52 for the Ms capability -- then ignore it. We only support OSC 52 (for now) if not seq:match('^\027%]52') then -- cgit From adb2258345409d08c42809da0212eeb792e70106 Mon Sep 17 00:00:00 2001 From: "Samuel (ThinLinc team)" Date: Tue, 28 Nov 2023 12:17:39 +0100 Subject: fix(rplugin): dont create data dir if it's a broken symlink #25726 Checking if it's non-empty and not a directory gets us quite far, but not all the way. While a working symlink would trigger the earlier checks, a broken symlink does not. This commit fixes the special case where ~/.local/share/nvim already exists but is a broken symlink. Thus, it fixes the following error on startup: E739: Cannot create directory /home/samuel/.local/share/nvim: file already exists --- runtime/plugin/rplugin.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/rplugin.vim b/runtime/plugin/rplugin.vim index 52f4bd05bc..bb637fcb77 100644 --- a/runtime/plugin/rplugin.vim +++ b/runtime/plugin/rplugin.vim @@ -14,7 +14,9 @@ function! s:GetManifestPath() abort let dest = stdpath('data') if !empty(dest) if !isdirectory(dest) - call mkdir(dest, 'p', 0700) + if getftype(dest) != "link" + call mkdir(dest, 'p', 0700) + endif endif let manifest_base = dest endif -- cgit From a9b4dc9614a0e49438a1a1569a5c0319aa2cac9d Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:02:44 -0600 Subject: fix(man): set the nested flag for the BufReadCmd autocommand (#26285) The nested flag must be set so that other autocommands can fire while the BufReadCmd is still executing. --- runtime/plugin/man.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.lua b/runtime/plugin/man.lua index 50a48fe7f2..512b1f63e8 100644 --- a/runtime/plugin/man.lua +++ b/runtime/plugin/man.lua @@ -29,6 +29,7 @@ local augroup = vim.api.nvim_create_augroup('man', {}) vim.api.nvim_create_autocmd('BufReadCmd', { group = augroup, pattern = 'man://*', + nested = true, callback = function(params) require('man').read_page(vim.fn.matchstr(params.match, 'man://\\zs.*')) end, -- cgit