From d3cd79709b6491a5806c67ea52c19f244164954e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 25 Aug 2022 00:49:33 +0200 Subject: vim-patch:fd999452adaf (#19929) Update runtime files https://github.com/vim/vim/commit/fd999452adaf529a30d78844b5fbee355943da29 --- runtime/plugin/matchparen.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index cc4f38f669..ce2225c5f8 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -5,8 +5,7 @@ " Exit quickly when: " - this plugin was already loaded (or disabled) " - when 'compatible' is set -" - the "CursorMoved" autocmd event is not available. -if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved") +if exists("g:loaded_matchparen") || &cp finish endif let g:loaded_matchparen = 1 @@ -20,7 +19,7 @@ endif augroup matchparen " Replace all matchparen autocommands - autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair() + autocmd! CursorMoved,CursorMovedI,WinEnter,WinScrolled * call s:Highlight_Matching_Pair() autocmd! WinLeave * call s:Remove_Matches() if exists('##TextChanged') autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() -- cgit From 2afcdbd63a5b0cbeaad9d83b096a3af5201c67a9 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 2 Sep 2022 15:20:29 +0100 Subject: feat(Man): port to Lua (#19912) Co-authored-by: zeertzjq --- runtime/plugin/man.lua | 34 ++++++++++++++++++++++++++++++++++ runtime/plugin/man.vim | 15 --------------- 2 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 runtime/plugin/man.lua delete mode 100644 runtime/plugin/man.vim (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.lua b/runtime/plugin/man.lua new file mode 100644 index 0000000000..4b1528b0cb --- /dev/null +++ b/runtime/plugin/man.lua @@ -0,0 +1,34 @@ +if vim.g.loaded_man ~= nil then + return +end +vim.g.loaded_man = true + +vim.api.nvim_create_user_command('Man', function(params) + local man = require('man') + if params.bang then + man.init_pager() + else + local ok, err = pcall(man.open_page, params.count, params.smods, params.fargs) + if not ok then + vim.notify(man.errormsg or err, vim.log.levels.ERROR) + end + end +end, { + bang = true, + bar = true, + addr = 'other', + nargs = '*', + complete = function(...) + return require('man').man_complete(...) + end, +}) + +local augroup = vim.api.nvim_create_augroup('man', {}) + +vim.api.nvim_create_autocmd('BufReadCmd', { + group = augroup, + pattern = 'man://*', + callback = function(params) + require('man').read_page(vim.fn.matchstr(params.match, 'man://\\zs.*')) + end, +}) diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim deleted file mode 100644 index b10677593f..0000000000 --- a/runtime/plugin/man.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Maintainer: Anmol Sethi - -if exists('g:loaded_man') - finish -endif -let g:loaded_man = 1 - -command! -bang -bar -addr=other -complete=customlist,man#complete -nargs=* Man - \ if 0 | call man#init_pager() | - \ else | call man#open_page(, , ) | endif - -augroup man - autocmd! - autocmd BufReadCmd man://* call man#read_page(matchstr(expand(''), 'man://\zs.*')) -augroup END -- cgit From 65e8ed45de98bf93491c6740772f0a42834696ab Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 29 Nov 2022 10:17:57 +0800 Subject: vim-patch:9.0.0969: matchparen highlight is not updated when switching buffers (#21227) Problem: Matchparen highlight is not updated when switching buffers. Solution: Listen to the BufLeave and the BufWinEnter autocmd events. (closes vim/vim#11626) https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7 Co-authored-by: Bram Moolenaar --- runtime/plugin/matchparen.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index ce2225c5f8..eb4a9ecf7c 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar -" Last Change: 2021 Apr 08 +" Last Change: 2022 Nov 28 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -19,8 +19,8 @@ endif augroup matchparen " Replace all matchparen autocommands - autocmd! CursorMoved,CursorMovedI,WinEnter,WinScrolled * call s:Highlight_Matching_Pair() - autocmd! WinLeave * call s:Remove_Matches() + autocmd! CursorMoved,CursorMovedI,WinEnter,BufWinEnter,WinScrolled * call s:Highlight_Matching_Pair() + autocmd! WinLeave,BufLeave * call s:Remove_Matches() if exists('##TextChanged') autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() endif -- cgit From 35767769036671d5ce562f53cae574f9c66e4bb2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 8 Dec 2022 16:33:38 +0100 Subject: vim-patch:86b4816766d9 (#21314) Update runtime files https://github.com/vim/vim/commit/86b4816766d976a7ecd4403eca1f8bf6b4105800 vim-patch:9.0.1029: autoload directory missing from distribution Problem: Autoload directory missing from distribution. Solution: Add the autoload/zig directory to the list of distributed files. https://github.com/vim/vim/commit/84dbf855fb2d883481f74ad0ccf3df3f8837e6bf Co-authored-by: Bram Moolenaar --- runtime/plugin/matchparen.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index eb4a9ecf7c..3982489b92 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar -" Last Change: 2022 Nov 28 +" Last Change: 2022 Dec 01 " Exit quickly when: " - this plugin was already loaded (or disabled) -- cgit From ef91146efcece1b6d97152251e7137d301146189 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 14 Dec 2022 10:46:54 +0100 Subject: feat: `vim.inspect_pos`, `vim.show_pos`, `:Inspect` --- runtime/plugin/nvim.lua | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 runtime/plugin/nvim.lua (limited to 'runtime/plugin') diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua new file mode 100644 index 0000000000..815886f896 --- /dev/null +++ b/runtime/plugin/nvim.lua @@ -0,0 +1,7 @@ +vim.api.nvim_create_user_command('Inspect', function(cmd) + if cmd.bang then + vim.pretty_print(vim.inspect_pos()) + else + vim.show_pos() + end +end, { desc = 'Inspect highlights and extmarks at the cursor', bang = true }) -- cgit From ab9a2c49253413dbbb31756a3eeddb354a663035 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Tue, 3 Jan 2023 09:13:18 -0700 Subject: feat(editorconfig): add builtin EditorConfig support --- runtime/plugin/editorconfig.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 runtime/plugin/editorconfig.lua (limited to 'runtime/plugin') diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua new file mode 100644 index 0000000000..60eb861aaa --- /dev/null +++ b/runtime/plugin/editorconfig.lua @@ -0,0 +1,11 @@ +if vim.g.editorconfig_enable == false or vim.g.editorconfig_enable == 0 then + return +end + +local group = vim.api.nvim_create_augroup('editorconfig', {}) +vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, { + group = group, + callback = function(args) + require('editorconfig').config(args.buf) + end, +}) -- cgit From 34d1eaa792fa332cea190568967a489e324fca6f Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 4 Jan 2023 14:36:18 -0700 Subject: feat(editorconfig): allow editorconfig to be toggled dynamically Rather than only check `editorconfig_enable` when the plugin is loaded, check it each time the autocommand fires, so that users may enable or disable it dynamically. Also check for a buffer local version of the variable, so that editorconfig can be enabled or disabled per-buffer. --- runtime/plugin/editorconfig.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index 60eb861aaa..c715279fd5 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -1,11 +1,14 @@ -if vim.g.editorconfig_enable == false or vim.g.editorconfig_enable == 0 then - return -end - local group = vim.api.nvim_create_augroup('editorconfig', {}) 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_enable, vim.F.if_nil(vim.g.editorconfig_enable, true)) + if not enable then + return + end + require('editorconfig').config(args.buf) end, }) -- cgit From 6ffa434f0b1c6e82fb6c1445d5d7382e0ef22e07 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 4 Jan 2023 15:10:19 -0700 Subject: refactor(editorconfig)!: change editorconfig_enable to editorconfig --- runtime/plugin/editorconfig.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index c715279fd5..54cd0e828e 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -3,8 +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_enable, vim.F.if_nil(vim.g.editorconfig_enable, true)) + local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) if not enable then return end -- cgit