From 6320c91c50e4c0ee5c366241f9a413c4edbfdad8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 26 Jan 2023 09:58:27 +0800 Subject: vim-patch:9.0.1231: completion of :runtime does not handle {where} argument Problem: Completion of :runtime does not handle {where} argument. Solution: Parse the {where} argument. (closes vim/vim#11863) https://github.com/vim/vim/commit/3770f4c9cde7b5fcd10b6fa2e665cd0b69450fb2 --- runtime/doc/builtin.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 4d2c85b134..c20f52967b 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2991,6 +2991,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* messages |:messages| suboptions option options packadd optional package |pack-add| names + runtime runtime file names |:runtime| scriptnames sourced script names |:scriptnames| shellcmd Shell command sign |:sign| suboptions -- cgit From f03f6263bb3eb0b28b759292cb6ef4465a05cafe Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 26 Jan 2023 10:38:53 +0800 Subject: vim-patch:9.0.1238: :runtime completion can be further improved Problem: :runtime completion can be further improved. Solution: Also complete the {where} argument values and adjust the completion for that. (closes vim/vim#11874) https://github.com/vim/vim/commit/5c8771bc5a2be123ab8e6325fa60ed524e8efb09 --- runtime/doc/builtin.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c20f52967b..c8f5570bae 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2991,7 +2991,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* messages |:messages| suboptions option options packadd optional package |pack-add| names - runtime runtime file names |:runtime| + runtime |:runtime| completion scriptnames sourced script names |:scriptnames| shellcmd Shell command sign |:sign| suboptions -- cgit From e02df23b4e24046d99c7bfa6a63b4db16c28a7be Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 26 Jan 2023 19:35:06 +0800 Subject: docs: clarify :runtime behavior without [where] again (#22003) The behavior changed again after #15867, change the docs to describe latest behavior. --- runtime/doc/repeat.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 1bbd20702b..bf77aacdc0 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -211,9 +211,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. When [!] is included, all found files are sourced. Else only the first found file is sourced. - When [where] is omitted, first 'runtimepath' is - searched, then directories under "start" in 'packpath' - are searched. + When [where] is omitted only 'runtimepath' is used. Other values: START search only under "start" in 'packpath' OPT search only under "opt" in 'packpath' -- cgit From aec4b476c5689f032103ab3e0ca068fc2af8bbba Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 27 Jan 2023 11:24:20 +0000 Subject: docs(api): tweak data arg for nvim_create_autocmd (#22008) Fixes #21964 --- runtime/doc/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 0e1cc3c28c..95a929b808 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3281,7 +3281,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* • match: (string) expanded value of || • buf: (number) expanded value of || • file: (string) expanded value of || - • data: (any) arbitrary data passed to + • data: (any) arbitrary data passed from |nvim_exec_autocmds()| • command (string) optional: Vim command to execute on event. -- cgit From c032e83b22994332dd8769ef34cb817906a63cac Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 26 Jan 2023 09:42:23 +0100 Subject: fix(treesitter): validate language name Problem: Some injections (like markdown) allow specifying arbitrary language names for code blocks, which may be lead to errors when looking for a corresponding parser in runtime path. Solution: Validate that the language name only contains alphanumeric characters and `_` (e.g., for `c_sharp`) and error otherwise. --- runtime/doc/treesitter.txt | 1 + runtime/lua/vim/treesitter/language.lua | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 917863eef8..9bfdc0b94e 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -684,6 +684,7 @@ require_language({lang}, {path}, {silent}, {symbol_name}) Parameters: ~ • {lang} (string) Language the parser should parse + (alphanumerical and `_` only) • {path} (string|nil) Optional path the parser is located at • {silent} (boolean|nil) Don't throw an error if language not found diff --git a/runtime/lua/vim/treesitter/language.lua b/runtime/lua/vim/treesitter/language.lua index c92d63b8c4..8634e53b7b 100644 --- a/runtime/lua/vim/treesitter/language.lua +++ b/runtime/lua/vim/treesitter/language.lua @@ -6,7 +6,7 @@ local M = {} --- --- Parsers are searched in the `parser` runtime directory, or the provided {path} --- ----@param lang string Language the parser should parse +---@param lang string Language the parser should parse (alphanumerical and `_` only) ---@param path (string|nil) Optional path the parser is located at ---@param silent (boolean|nil) Don't throw an error if language not found ---@param symbol_name (string|nil) Internal symbol name for the language to load @@ -16,13 +16,19 @@ function M.require_language(lang, path, silent, symbol_name) return true end if path == nil then - local fname = 'parser/' .. vim.fn.fnameescape(lang) .. '.*' + if not (lang and lang:match('[%w_]+') == lang) then + if silent then + return false + end + error("'" .. lang .. "' is not a valid language name") + end + + local fname = 'parser/' .. lang .. '.*' local paths = a.nvim_get_runtime_file(fname, false) if #paths == 0 then if silent then return false end - error("no parser for '" .. lang .. "' language, see :help treesitter-parsers") end path = paths[1] -- cgit From 8144deb0989ea5c61fe9a1a5802d230eba33dfdd Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 29 Jan 2023 10:39:20 +0100 Subject: vim-patch:9.0.1256: NetworkManager connection files are not recognized (#22038) Problem: NetworkManager connection files are not recognized. Solution: Add a pattern for NetworkManager connection files. (closes vim/vim#11893) https://github.com/vim/vim/commit/04e4f1d98556e67d7337224b67b71c828410ee0f Co-authored-by: ObserverOfTime --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 9293c828b8..0a26e363d5 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -226,6 +226,7 @@ local extension = { hook = function(path, bufnr) return M.getlines(bufnr, 1) == '[Trigger]' and 'conf' end, + nmconnection = 'confini', mklx = 'context', mkiv = 'context', mkii = 'context', -- cgit From c9ac4e487706658852f0e6c2e71cf669dafba90b Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 29 Jan 2023 14:19:07 -0500 Subject: vim-patch:9.0.1261: Elsa files are not recognized (#22047) Problem: Elsa files are not recognized. Solution: Add the name of Elsa files. (Amaan Qureshi) https://github.com/vim/vim/commit/2a99fe6c41efcd5d1eb47823e7e73cf391e230ba --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 0a26e363d5..1e7b85060e 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -332,6 +332,7 @@ local extension = { am = 'elf', exs = 'elixir', elm = 'elm', + lc = 'elsa', elv = 'elvish', ent = function(path, bufnr) return require('vim.filetype.detect').ent(bufnr) -- cgit From 27b81af19c498892f4b0444ad29b7be842f8e7b8 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 30 Jan 2023 19:06:32 +0100 Subject: refactor!: remove has("debug") (#22060) This value can not be relied on as it doesn't work for multi-configuration generators. I don't think this undocumented option is used much, if at all, so I think we should remove it. --- runtime/lua/nvim/health.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/lua/nvim/health.lua b/runtime/lua/nvim/health.lua index b76106f241..f11899434e 100644 --- a/runtime/lua/nvim/health.lua +++ b/runtime/lua/nvim/health.lua @@ -156,13 +156,10 @@ local function check_performance() health.report_ok(buildtype) else health.report_info(buildtype) - health.report_warn( - 'Non-optimized ' .. (has('debug') and '(DEBUG) ' or '') .. 'build. Nvim will be slower.', - { - 'Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.', - suggest_faq, - } - ) + health.report_warn('Non-optimized debug build. Nvim will be slower.', { + 'Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.', + suggest_faq, + }) end -- check for slow shell invocation -- cgit From b649a96fc09fa7f18a988b0b0be5dadb54ad49de Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 31 Jan 2023 08:12:10 +0100 Subject: vim-patch:9.0.1263: KDL files are not recognized (#22058) Problem: KDL files are not recognized. Solution: Add a pattern for KDL files. (Amaan Qureshi, closes vim/vim#11898) https://github.com/vim/vim/commit/907349a74331fc1bc48cf43c1e7d54cb9e0e4fc9 Co-authored-by: Amaan Qureshi --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 1e7b85060e..b356f3d7aa 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -569,6 +569,7 @@ local extension = { libsonnet = 'jsonnet', jsp = 'jsp', jl = 'julia', + kdl = 'kdl', kv = 'kivy', kix = 'kix', kts = 'kotlin', -- cgit From d6d6ab3f8e77d54c8030c0c18f17d3c72ac4445c Mon Sep 17 00:00:00 2001 From: bfredl Date: Sat, 26 Feb 2022 15:19:10 +0100 Subject: feat(lua): low-level interpreter mode (nvim -ll) --- runtime/doc/starting.txt | 8 ++++++++ runtime/lua/vim/_init_packages.lua | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 179bacdb24..5e0718c3bb 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -239,6 +239,14 @@ argument. Disables |shada| unless |-i| was given. Disables swapfile (like |-n|). + *-ll* +-ll {script} [args] + Execute a lua script, similarly to |-l|, but the editor is not + initialized. This gives a lua enviroment similar to a worker + thread. See |lua-loop-threading|. + + Unlike `-l` no prior arguments are allowed. + *-b* -b Binary mode. File I/O will only recognize to separate lines. The 'expandtab' option will be reset. The 'textwidth' diff --git a/runtime/lua/vim/_init_packages.lua b/runtime/lua/vim/_init_packages.lua index 0c4ee8636d..e3a442af5e 100644 --- a/runtime/lua/vim/_init_packages.lua +++ b/runtime/lua/vim/_init_packages.lua @@ -42,8 +42,11 @@ function vim._load_package(name) return nil end --- Insert vim._load_package after the preloader at position 2 -table.insert(package.loaders, 2, vim._load_package) +-- TODO(bfredl): dedicated state for this? +if vim.api then + -- Insert vim._load_package after the preloader at position 2 + table.insert(package.loaders, 2, vim._load_package) +end -- builtin functions which always should be available require('vim.shared') @@ -78,6 +81,6 @@ function vim.empty_dict() end -- only on main thread: functions for interacting with editor state -if not vim.is_thread() then +if vim.api and not vim.is_thread() then require('vim._editor') end -- cgit From d63ad600e0571ccf07eed1e841e8519da7d4af9f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 1 Feb 2023 10:08:50 +0100 Subject: vim-patch:9.0.1268: .clangd and .stylelintrc files don't get a filetype (#22079) Problem: .clangd and .stylelintrc files don't get a filetype. Solution: Use yaml for .clangd and json for .stylelintrc files. (Mark Skelton, closes vim/vim#11916) https://github.com/vim/vim/commit/9c51798a1f3b79ace5ae0551a8bb122025ac94ed Co-authored-by: Mark Skelton --- runtime/lua/vim/filetype.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index b356f3d7aa..d1a84fcecf 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1464,6 +1464,7 @@ local filename = { ['Pipfile.lock'] = 'json', ['.firebaserc'] = 'json', ['.prettierrc'] = 'json', + ['.stylelintrc'] = 'json', ['.babelrc'] = 'jsonc', ['.eslintrc'] = 'jsonc', ['.hintrc'] = 'jsonc', @@ -1699,6 +1700,7 @@ local filename = { fglrxrc = 'xml', ['/etc/blkid.tab'] = 'xml', ['/etc/blkid.tab.old'] = 'xml', + ['.clangd'] = 'yaml', ['.clang-format'] = 'yaml', ['.clang-tidy'] = 'yaml', ['/etc/zprofile'] = 'zsh', -- cgit From 9ce44a750c2a65082962effe6ce4d185b7698d73 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 1 Feb 2023 17:21:42 +0000 Subject: fix(man): use italics for `_` (#22086) fix(man): use italics for _ Even though underline is strictly what this should be. _ was used by nroff to indicate italics which wasn't possible on old typewriters so underline was used. Modern terminals now support italics so lets use that now. See: - https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795 - https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm --- runtime/lua/man.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 732a4ab92e..0956022ac6 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -149,15 +149,21 @@ local function highlight_line(line, linenr) if overstrike then local last_hl = hls[#hls] if char == prev_char then - if char == '_' and attr == UNDERLINE and last_hl and last_hl.final == byte then - -- This underscore is in the middle of an underlined word - attr = UNDERLINE + if char == '_' and attr == ITALIC and last_hl and last_hl.final == byte then + -- This underscore is in the middle of an italic word + attr = ITALIC else attr = BOLD end elseif prev_char == '_' then - -- char is underlined - attr = UNDERLINE + -- Even though underline is strictly what this should be. _ was used by nroff to + -- indicate italics which wasn't possible on old typewriters so underline was used. Modern + -- terminals now support italics so lets use that now. + -- See: + -- - https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795 + -- - https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm + -- attr = UNDERLINE + attr = ITALIC elseif prev_char == '+' and char == 'o' then -- bullet (overstrike text '+^Ho') attr = BOLD -- cgit From cb97d5425a0b6e77267795607ff45255a4ac1c22 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Wed, 1 Feb 2023 23:26:26 -0700 Subject: docs: clarify "pipe" mode for sockconnect Make it more clear that on unix the "pipe" mode of sockconnect uses unix local domain sockets, not named pipes (FIFOs) which are not currently supported. See discussion in #22080. Signed-off-by: Thayne McCombs --- runtime/doc/builtin.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c8f5570bae..2fc7dce7fc 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1959,7 +1959,7 @@ exp({expr}) *exp()* Compute()->exp() expand({string} [, {nosuf} [, {list}]]) *expand()* - Expand wildcards and the following special keywords in + Expand wildcards and the following special keywords in {string}. 'wildignorecase' applies. If {list} is given and it is |TRUE|, a List will be returned. @@ -7569,10 +7569,14 @@ sinh({expr}) *sinh()* sockconnect({mode}, {address} [, {opts}]) *sockconnect()* Connect a socket to an address. If {mode} is "pipe" then - {address} should be the path of a named pipe. If {mode} is - "tcp" then {address} should be of the form "host:port" where - the host should be an ip adderess or host name, and port the - port number. + {address} should be the path of a local domain socket (on + unix) or named pipe (on Windows). If {mode} is "tcp" then + {address} should be of the form "host:port" where the host + should be an ip adderess or host name, and port the port + number. + + For "pipe" mode, see |luv-pipe-handle|. For "tcp" mode, see + |luv-tcp-handle|. Returns a |channel| ID. Close the socket with |chanclose()|. Use |chansend()| to send data over a bytes socket, and -- cgit From 405f0a8c3fb6c9941418c4e205b41e3ad32d0fb0 Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 2 Feb 2023 14:37:44 +0100 Subject: build: update release data --- runtime/nvim.appdata.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime') diff --git a/runtime/nvim.appdata.xml b/runtime/nvim.appdata.xml index 7411a7190a..7d2ea49df4 100644 --- a/runtime/nvim.appdata.xml +++ b/runtime/nvim.appdata.xml @@ -26,9 +26,12 @@ + + + -- cgit From c05b3c3bbdef4018ce70f0c822c4a55654a9c186 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 2 Feb 2023 17:26:22 +0100 Subject: vim-patch:9.0.1274: FIRRTL files are not recognized (#22102) Problem: FIRRTL files are not recognized. Solution: Add a pattern for FIRRTL files. (Amaan Qureshi, closes vim/vim#11931) https://github.com/vim/vim/commit/685bf83b73d0fe6fd36bb2949bebd6aae66a139e Co-authored-by: Amaan Qureshi --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d1a84fcecf..8144731b09 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -385,6 +385,7 @@ local extension = { ['m4gl'] = 'fgl', ['4gl'] = 'fgl', ['4gh'] = 'fgl', + fir = 'firrtl', fish = 'fish', focexec = 'focexec', fex = 'focexec', -- cgit