aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.lua
Commit message (Collapse)AuthorAge
...
* feat(server): serverlist({info=true}) gets detailed info #39392Szymon Wilczek2026-05-06
| | | | | | | | | | | | | | | | | Problem: UI tools and orchestration engines need more context than just raw socket addresses from serverlist(). Without knowing if a server belongs to the current instance or knowing its PID, UIs cannot display meaningful options to users. Solution: - Added the `info=v:true` option to `serverlist()`. - When `info` is requested, it implies `peer=true` and returns a list of dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and `own`. - Uses an RPC request to `getpid()` across the socket to fetch the peer's actual process ID. Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
* feat(doc): document Lua alternative for vim.fnLewis Russell2026-04-27
| | | | AI-assisted: Codex
* docs: misc #39256Justin M. Keyes2026-04-25
|
* refactor(vimfn): full-Lua impl of vim.fn.environ()Justin M. Keyes2026-04-18
|
* perf(vim.fn): call Lua-implemented vim.fn.xx() directly #39166Justin M. Keyes2026-04-17
| | | | | | | | | | | | | | | | | | | | | | | | Problem: - Builtin "Vimscript" functions (f_xx) are mostly implemented in C. Partly that's because there is some boilerplate required to call out to Lua. - Calls to `vim.fn.foo()` always marshall over the Lua <=> Vimscript ("typval") bridge, even if `fn.foo()` is implemented entirely in Lua: ``` Lua => typval => Object => Lua => Object => typval => Lua. ``` Solution: Functions declared in eval.lua with `func_lua` are implemented in entirely in Lua (`_core/vimfn.lua`). - `gen_eval.lua` wires `func_lua` entries to `lua_wrapper`, which handles the typval conversion for Vimscript callers (slow path). - `nlua_call()` detects `func_lua` functions and calls the Lua implementation directly. This eliminates all conversion overhead for Lua callers (fast path). - Validate at build-time that `func`, `func_float`, and `func_lua` are mutually exclusive. - Migrate `hostname()` as a toy example, to show the idea.
* vim-patch:8.2.2440: documentation based on patches is outdated (#39144)zeertzjq2026-04-17
| | | | | | | | | | | Problem: Documentation based on patches is outdated. Solution: Add changes to documentation in a patch. https://github.com/vim/vim/commit/853886722c051ecaef6d818ce32a822e4f43dc2b Trailing space was removed in later patches. Also fix a few more misplaced error numbers from #8155. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* docs: miscJustin M. Keyes2026-04-12
| | | | | | | | Close #38748 Close #38866 Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com> Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
* docs: news #38464Justin M. Keyes2026-03-28
|
* feat(prompt): prompt_appendbuf() appends to prompt buffer #37763Shadman2026-03-27
| | | | | | | | | | | Problem: Currently, we recommend always inserting text above prompt-line in prompt-buffer. This can be done using the `:` mark. However, although we recommend it this way it can sometimes get confusing how to do it best. Solution: Provide an api to append text to prompt buffer. This is a common use-case for things using prompt-buffer.
* docs: api, plugins, ui2Justin M. Keyes2026-03-24
|
* docs: miscJustin M. Keyes2026-03-20
|
* feat(vimscript): scripts can detect 'android', 'termux' #38218TomIO2026-03-16
| | | | | | | | | | | | | | | | Problem: The 'android' and 'termux' feature flags have been shipped in the downstream neovim/neovim-nightly package for 5+ years but were never properly documented in the downstream patch. Solution: Upstream the 'android' and 'termux' feature flags into Neovim as decoupled feature flags, this enables the 'android' feature in particular to be available independently of the 'termux' feature for builds of Neovim against the Android NDK, but not including the Termux NDK patchset. Co-authored-by: Lethal Lisa <43791059+lethal-lisa@users.noreply.github.com> Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
* docs: miscJustin M. Keyes2026-03-13
|
* docs: vimfn descriptionsJustin M. Keyes2026-03-12
|
* docs: miscJustin M. Keyes2026-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | Close #37458 Close #37838 Close #37840 Close #37872 Close #37890 Close #38016 Close #38051 Close #38189 Close #38225 Close #38243 Close #38250 Co-authored-by: Colin Kennedy <colinvfx@gmail.com> Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com> Co-authored-by: Austin Rambo <ramboaustin13@gmail.com> Co-authored-by: Jonathan Birk <1965620+cafce25@users.noreply.github.com> Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Co-authored-by: Saad Nadeem <saadndm.sn@gmail.com> Co-authored-by: brianhuster <phambinhanctb2004@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Yi Ming <ofseed@foxmail.com>
* feat(highlight): support more SGR attributes #37901Riccardo Mazzarini2026-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: TUI does not support several standard SGR text attributes: - dim/faint (SGR 2) - blink (SGR 5) - conceal (SGR 8) - overline (SGR 53) This means that when a program running in the embedded terminal emits one of these escape codes, we drop it and don't surface it to the outer terminal. Solution: - Add support for those attributes. - Also add corresponding flags to `nvim_set_hl` opts, so users can set these attributes in highlight groups. - refactor(highlight): widen `HlAttrFlags` from `int16_t` to `int32_t` Widen the `rgb_ae_attr` and `cterm_ae_attr` fields in HlAttrs from int16_t to int32_t to make room for new highlight attribute flags, since there was only one spare bit left. - The C flag is named HL_CONCEALED to avoid colliding with the existing HL_CONCEAL in syntax.h (which is a syntax group flag, not an SGR attribute). - Also note that libvterm doesn't currently support the dim and overline attributes, so e.g. `printf '\e[2mThis should be dim\n'` and `printf '\e[53mThis should have an overline\n'` are still not rendered correctly when run from the embedded terminal.
* vim-patch:partial:9.1.1668: items() does not work for Blobszeertzjq2026-02-16
| | | | | | | | | | | | Problem: items() does not work for Blobs Solution: Extend items() to support Blob (Yegappan Lakshmanan). closes: vim/vim#18080 https://github.com/vim/vim/commit/da34f84847d40dc5b1eaad477440e513968047dc Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:3de7384: runtime(doc): Fix :help complete() example (#37891)zeertzjq2026-02-16
| | | | | | | closes: vim/vim#18417 https://github.com/vim/vim/commit/3de73844afebe133ea7485cc9993bb8378a3717d Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* docs(eval): fix fn.strchar types #37737Mike J McGuirk2026-02-08
| | | | | | | | | | | | | | | | Problem: The following strchar functions have incorrect types: strcharlen() - Currently any. Always returns an integer, including on error strcharpart() - The skipcc annotation does not specify that 0 and 1 are valid. These inputs are required for vimscript usage. The current return type is any, even though the function returns an empty string on error strchars() - The skipcc annotation does not specify that 0 and 1 are valid Solution: Update the problem types.
* docs(eval): correct types for getcharsearch, setcharsearch #37734Mike J McGuirk2026-02-08
| | | | | | | | | Problem: In eval.lua, setcharsearch() has an incorrect param type, causing Lua_Ls to display an error when a valid table is passed. While getcharsearch correctly states that it returns a table, the type is non-specific about the contents. Solution: Update eval.lua with the correct types.
* vim-patch:dd9f7e6: runtime(doc): Fix some overlength lineszeertzjq2026-02-01
| | | | | | | | closes: vim/vim#19286 https://github.com/vim/vim/commit/dd9f7e6cbbba6d8e63cca3b4c537dc9b8cc1837a Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:93eb081: runtime(doc): Clarify visual mark behavior in getpos(), ↵zeertzjq2026-01-03
| | | | | | | | | | | | | | setpos() (#37223) Add documentation notes explaining that visual marks '< and '> have different behaviors in getpos() and setpos(). Also fix a small typo. closes: vim/vim#19070 https://github.com/vim/vim/commit/93eb081eee92180a495d72a495542b24a873e2f3 Co-authored-by: Larson, Eric <numeric.larson@gmail.com>
* vim-patch:bfb9f5c: runtime(doc): Rename NoDefaultCurrentDirectoryInExePath ↵zeertzjq2025-12-12
| | | | | | | | | | | | tag (#36921) - Add leading "$" to match other environment variable tags. - Clarify :help $NoDefaultCurrentDirectoryInExePath. closes: vim/vim#18895 https://github.com/vim/vim/commit/bfb9f5c40ea5dd07fc0747c5ffd44d5b32dbcf62 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 ↵zeertzjq2025-12-12
| | | | | | | | | | | | in printf() (#36919) Problem: crash with invalid positional argument 0 in printf() Solution: Reject positional arguments <= 0. closes: vim/vim#18898 https://github.com/vim/vim/commit/98a0cbf05bd45fa6c4ede7b791fd21760bc587c8 Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs: miscJustin M. Keyes2025-12-06
| | | | | | fix https://github.com/neovim/neovim.github.io/issues/419 Co-authored-by: Rob Pilling <robpilling@gmail.com>
* fix(ui): close outdated cmdline pum on redraw (#36815)zeertzjq2025-12-05
|
* vim-patch:9.1.1944: getwininfo() does not return if statusline is visible ↵zeertzjq2025-12-05
| | | | | | | | | | | | | (#36828) Problem: gewininfo() does not return if statusline is visible Solution: Add status_height to the dict items returned by getwininfo() (Hirohito Higashi) closes: vim/vim#18841 https://github.com/vim/vim/commit/a04ab5f04c1a9e794ed45ff5f8f7e1f9c5e1a535 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:9.1.1948: Windows: Vim adds current directory to search pathzeertzjq2025-12-04
| | | | | | | | | | | | | | | | Problem: Windows: Vim always adds the current directory to search path. This should only happen when using cmd.exe as 'shell'. For example, powershell won't run binaries from the current directory. Solution: Only add current directory to system path, when using cmd.exe as 'shell'. related: vim/vim#10341 related: 083ec6d9a3b7 https://github.com/vim/vim/commit/4d87c9742a544a58c05cb34d4fbaac47e410b369 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.1947: [security]: Windows: Vim may execute commands from ↵zeertzjq2025-12-04
| | | | | | | | | | | | | | | | current directory Problem: [security]: Windows: Vim may execute commands from current directory (Simon Zuckerbraun) Solution: Set the $NoDefaultCurrentDirectoryInExePath before running external commands. Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-g77q-xrww-p834 https://github.com/vim/vim/commit/083ec6d9a3b7b09006e0ce69ac802597d25856d6 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.1933: completion: complete_match() is not useful (#36726)zeertzjq2025-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: completion: complete_match() Vim script function and 'isexpand' option are not that useful and confusing (after v9.1.1341) Solution: Remove function and option and clean up code and documentation (Girish Palya). complete_match() and 'isexpand' add no real functionality to Vim. They duplicate what `strridx()` already does, yet pretend to be part of the completion system. They have nothing to do with the completion mechanism. * `f_complete_match()` in `insexpand.c` does not call any completion code. It’s just a `STRNCMP()` wrapper with fluff logic. * `'isexpand'` exists only as a proxy argument to that function. It does nothing on its own and amounts to misuse of a new option. The following Vim script function can be used to implement the same functionality: ```vim func CompleteMatch(triggers, sep=',') let line = getline('.')->strpart(0, col('.') - 1) let result = [] for trig in split(a:triggers, a:sep) let idx = strridx(line, trig) if l:idx >= 0 call add(result, [idx + 1, trig]) endif endfor return result endfunc ``` related: vim/vim#16716 fixes: vim/vim#18563 closes: vim/vim#18790 https://github.com/vim/vim/commit/cbcbff871224115c45bbd14582749a487c6fad30 Co-authored-by: Girish Palya <girishji@gmail.com>
* docs: vimdoc parsing errors #36681Justin M. Keyes2025-11-24
| | | | | | | | | | Error: .tests/neovim/runtime/doc/dev_test.txt (MISSING "`" [420, 79] - [420, 79]) Error: .tests/neovim/runtime/doc/news.txt (MISSING "`" [137, 80] - [137, 80]) Error: .tests/neovim/runtime/doc/nvim.txt (MISSING "<" [106, 0] - [106, 0]) Error: .tests/neovim/runtime/doc/vimfn.txt (MISSING "}" [2610, 26] - [2610, 26])
* docs: miscJustin M. Keyes2025-11-23
| | | | | | | | | | Close #36441 Close #36631 Close #36656 Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com>
* docs: getpos, getregion, lspJustin M. Keyes2025-11-15
|
* vim-patch:c28b73d: runtime(doc): Improve :help synconcealed() descriptionzeertzjq2025-11-09
| | | | | | | | closes: vim/vim#18698 https://github.com/vim/vim/commit/c28b73d34990e574ebd7542fe0adb789fc0bd674 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:9.1.1876: pre-inserted text not exposed in complete_info() (#36342)zeertzjq2025-10-27
| | | | | | | | | | | | | Problem: pre-inserted text not exposed in complete_info() Solution: Add the pre-inserted text to the complete_info() Vim script function (Girish Palya) closes: vim/vim#18571 Feat: expose preinserted text in complete_info() https://github.com/vim/vim/commit/ef5bf58d8cb2c6332d4cbc89c1d352466772ecc3 Co-authored-by: Girish Palya <girishji@gmail.com>
* docs(vimfn): getcwd() behavior #36222Robert2025-10-21
|
* vim-patch:83eb1da: runtime(doc): Normalise formatting of builtin function ↵zeertzjq2025-10-14
| | | | | | | | | | | | | | descriptions (#36172) - Column align tags - Move tags to the same line as the function signature - Move descriptions to the line below the function signature - Add missing hyperlinks to builtins in the description text closes: vim/vim#18478 https://github.com/vim/vim/commit/83eb1da19eedbd56fe6100d7e9017b8ebca0a35b Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:partial:c58f91c: runtime(doc): Whitespace updates (#36160)zeertzjq2025-10-13
| | | | | | | | | | | | | | Use double sentence spacing and wrap lines at 'textwidth'. Code examples and tables were not wrapped unless this had already been done locally. closes: vim/vim#18453 https://github.com/vim/vim/commit/c58f91c035db09358c282f2a908e2aea4287785e Fix incorrect docs in :h ModeChanged. Cherry-pick :h bufnr() changes from patch 8.1.2080. Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:014c731: runtime(doc): make :h virtcol() more accurate (#35976)zeertzjq2025-10-01
| | | | | | | | | | | | | | The current description (especially the "unlimited width" part) is inaccurate in several ways: - The size of virtual text can depend on window width. In particular, the size of "above" virtual text can be equal to window width. - A double-width character that doesn't fit adds 1 to the virtual column of the following characters. - The size of 'showbreak' and 'breakindent' is counted. related: vim/vim#5713 closes: vim/vim#18447 https://github.com/vim/vim/commit/014c731fa50c28c94d56545938b6a05a86234c30
* vim-patch:4edaf89: runtime(doc): improve preinserted() doczeertzjq2025-09-30
| | | | | | | | | | Change the second "if" to "because", otherwise it may be misinterpreted that preinserted() can return non-zero just because these options are set. closes: vim/vim#18409 https://github.com/vim/vim/commit/4edaf8923335504c31810dc4c5213eaba84e7898
* vim-patch:9.1.1797: completion: autocompletion can be improvedzeertzjq2025-09-30
| | | | | | | | | | | | | | | | | | | | | Problem: completion: autocompletion can be improved Solution: Add support for "longest" and "preinsert" in 'autocomplete'; add preinserted() (Girish Palya) * Add support for "longest" in 'completeopt' when 'autocomplete' is enabled. (Note: the cursor position does not change automatically when 'autocomplete' is enabled.) * Add support for "preinsert" when 'autocomplete' is enabled. Ensure "preinsert" works the same with and without 'autocomplete' * introduce the preinserted() Vim script function, useful for defining custom key mappings. fixes: vim/vim#18314 closes: vim/vim#18387 https://github.com/vim/vim/commit/c05335082adb21d99d96374779856444a3a0688f Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:992e307: runtime(doc): update list of modifiers at :h expand() ↵zeertzjq2025-09-30
| | | | | | | | | (#35957) fixes: vim/vim#18435 https://github.com/vim/vim/commit/992e30774f5ec81f53d5554c42137d3c85999081 Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs: json, tests, lsp #35754Justin M. Keyes2025-09-28
| | | | | | | Close #35926 Close #35818 Co-authored-by: skewb1k <skewb1kunix@gmail.com> Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1774: cannot calculate sha256 of a Blobzeertzjq2025-09-21
| | | | | | | | | | | | Problem: cannot calculate sha256() of a Blob Solution: Change sha256() to accept a Blob or String argument (thinca). closes: vim/vim#18336 https://github.com/vim/vim/commit/4150283b837975152d36f87a2bb975e894bc965c Co-authored-by: thinca <thinca@gmail.com>
* docs: small fixes (#35791)zeertzjq2025-09-16
| | | | | | | | | | | | | | | | | | | | | Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
* vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletionzeertzjq2025-09-09
| | | | | | | | | | | - Address https://github.com/vim/vim/pull/18219#issuecomment-3264634710 - Make the cmdline-autocompletion help more user friendly closes: vim/vim#18245 https://github.com/vim/vim/commit/d7d6a6f05a536b443188ff95a45bbd46485f11fb Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:84a343a: runtime(doc): correct another problem in :h items()zeertzjq2025-08-21
| | | | | | | | The returned value is only in arbitrary order for a Dict. closes: vim/vim#18050 https://github.com/vim/vim/commit/84a343a6ed34995adc67c062b64533c1b0bf7fb1
* vim-patch:44c8072: runtime(doc): fix style and clarify items() function for ↵zeertzjq2025-08-21
| | | | | | | | | | String type related: vim/vim#18021 https://github.com/vim/vim/commit/44c8072ef64a7a218eb8cf4b72866921762633e4 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:partial:308a313: runtime(doc): Update help for the items() functionzeertzjq2025-08-21
| | | | | | | | closes: vim/vim#18021 https://github.com/vim/vim/commit/308a3130be89148cdaf83bfaf00e3e7c69ed2133 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* docs: misc, dev-api-fast, $XDG_STATE_HOME #35138Justin M. Keyes2025-08-17
|