summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/eval.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-18refactor(vimfn): full-Lua impl of vim.fn.environ()Justin M. Keyes1
2026-04-17perf(vim.fn): call Lua-implemented vim.fn.xx() directly #39166Justin M. Keyes1
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.
2026-04-17vim-patch:8.2.2440: documentation based on patches is outdated (#39144)zeertzjq1
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>
2026-04-12docs: miscJustin M. Keyes1
Close #38748 Close #38866 Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com> Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
2026-03-28docs: news #38464Justin M. Keyes1
2026-03-27feat(prompt): prompt_appendbuf() appends to prompt buffer #37763Shadman1
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.
2026-03-24docs: api, plugins, ui2Justin M. Keyes1
2026-03-20docs: miscJustin M. Keyes1
2026-03-16feat(vimscript): scripts can detect 'android', 'termux' #38218TomIO1
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>
2026-03-13docs: miscJustin M. Keyes1
2026-03-12docs: vimfn descriptionsJustin M. Keyes1
2026-03-11docs: miscJustin M. Keyes1
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>
2026-02-20feat(highlight): support more SGR attributes #37901Riccardo Mazzarini1
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.
2026-02-16vim-patch:partial:9.1.1668: items() does not work for Blobszeertzjq1
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>
2026-02-16vim-patch:3de7384: runtime(doc): Fix :help complete() example (#37891)zeertzjq1
closes: vim/vim#18417 https://github.com/vim/vim/commit/3de73844afebe133ea7485cc9993bb8378a3717d Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-08docs(eval): fix fn.strchar types #37737Mike J McGuirk1
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.
2026-02-08docs(eval): correct types for getcharsearch, setcharsearch #37734Mike J McGuirk1
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.
2026-02-01vim-patch:dd9f7e6: runtime(doc): Fix some overlength lineszeertzjq1
closes: vim/vim#19286 https://github.com/vim/vim/commit/dd9f7e6cbbba6d8e63cca3b4c537dc9b8cc1837a Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-01-03vim-patch:93eb081: runtime(doc): Clarify visual mark behavior in getpos(), ↵zeertzjq1
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>
2025-12-12vim-patch:bfb9f5c: runtime(doc): Rename NoDefaultCurrentDirectoryInExePath ↵zeertzjq1
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>
2025-12-12vim-patch:98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 ↵zeertzjq1
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>
2025-12-06docs: miscJustin M. Keyes1
fix https://github.com/neovim/neovim.github.io/issues/419 Co-authored-by: Rob Pilling <robpilling@gmail.com>
2025-12-05fix(ui): close outdated cmdline pum on redraw (#36815)zeertzjq1
2025-12-05vim-patch:9.1.1944: getwininfo() does not return if statusline is visible ↵zeertzjq1
(#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>
2025-12-04vim-patch:9.1.1948: Windows: Vim adds current directory to search pathzeertzjq1
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>
2025-12-04vim-patch:9.1.1947: [security]: Windows: Vim may execute commands from ↵zeertzjq1
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>
2025-11-28vim-patch:9.1.1933: completion: complete_match() is not useful (#36726)zeertzjq1
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>
2025-11-24docs: vimdoc parsing errors #36681Justin M. Keyes1
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])
2025-11-23docs: miscJustin M. Keyes1
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>
2025-11-15docs: getpos, getregion, lspJustin M. Keyes1
2025-11-09vim-patch:c28b73d: runtime(doc): Improve :help synconcealed() descriptionzeertzjq1
closes: vim/vim#18698 https://github.com/vim/vim/commit/c28b73d34990e574ebd7542fe0adb789fc0bd674 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-27vim-patch:9.1.1876: pre-inserted text not exposed in complete_info() (#36342)zeertzjq1
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>
2025-10-21docs(vimfn): getcwd() behavior #36222Robert1
2025-10-14vim-patch:83eb1da: runtime(doc): Normalise formatting of builtin function ↵zeertzjq1
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>
2025-10-13vim-patch:partial:c58f91c: runtime(doc): Whitespace updates (#36160)zeertzjq1
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>
2025-10-01vim-patch:014c731: runtime(doc): make :h virtcol() more accurate (#35976)zeertzjq1
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
2025-09-30vim-patch:4edaf89: runtime(doc): improve preinserted() doczeertzjq1
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
2025-09-30vim-patch:9.1.1797: completion: autocompletion can be improvedzeertzjq1
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>
2025-09-30vim-patch:992e307: runtime(doc): update list of modifiers at :h expand() ↵zeertzjq1
(#35957) fixes: vim/vim#18435 https://github.com/vim/vim/commit/992e30774f5ec81f53d5554c42137d3c85999081 Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-09-28docs: json, tests, lsp #35754Justin M. Keyes1
Close #35926 Close #35818 Co-authored-by: skewb1k <skewb1kunix@gmail.com> Co-authored-by: glepnir <glephunter@gmail.com>
2025-09-21vim-patch:9.1.1774: cannot calculate sha256 of a Blobzeertzjq1
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>
2025-09-16docs: small fixes (#35791)zeertzjq1
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>
2025-09-09vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletionzeertzjq1
- 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>
2025-08-21vim-patch:84a343a: runtime(doc): correct another problem in :h items()zeertzjq1
The returned value is only in arbitrary order for a Dict. closes: vim/vim#18050 https://github.com/vim/vim/commit/84a343a6ed34995adc67c062b64533c1b0bf7fb1
2025-08-21vim-patch:44c8072: runtime(doc): fix style and clarify items() function for ↵zeertzjq1
String type related: vim/vim#18021 https://github.com/vim/vim/commit/44c8072ef64a7a218eb8cf4b72866921762633e4 Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-21vim-patch:partial:308a313: runtime(doc): Update help for the items() functionzeertzjq1
closes: vim/vim#18021 https://github.com/vim/vim/commit/308a3130be89148cdaf83bfaf00e3e7c69ed2133 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-17docs: misc, dev-api-fast, $XDG_STATE_HOME #35138Justin M. Keyes1
2025-08-14vim-patch:9.1.1627: fuzzy matching can be improvedzeertzjq1
Problem: fuzzy-matching can be improved Solution: Implement a better fuzzy matching algorithm (Girish Palya) Replace fuzzy matching algorithm with improved fzy-based implementation The [current](https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/) fuzzy matching algorithm has several accuracy issues: * It struggles with CamelCase * It fails to prioritize matches at the beginning of strings, often ranking middle matches higher. After evaluating alternatives (see my comments [here](https://github.com/vim/vim/issues/17531#issuecomment-3112046897) and [here](https://github.com/vim/vim/issues/17531#issuecomment-3121593900)), I chose to adopt the [fzy](https://github.com/jhawthorn/fzy) algorithm, which: * Resolves the aforementioned issues. * Performs better. Implementation details This version is based on the original fzy [algorithm](https://github.com/jhawthorn/fzy/blob/master/src/match.c), with one key enhancement: **multibyte character support**. * The original implementation supports only ASCII. * This patch replaces ascii lookup tables with function calls, making it compatible with multibyte character sets. * Core logic (`match_row()` and `match_positions()`) remains faithful to the original, but now operates on codepoints rather than single-byte characters. Performance Tested against a dataset of **90,000 Linux kernel filenames**. Results (in milliseconds) show a **\~2x performance improvement** over the current fuzzy matching algorithm. ``` Search String Current Algo FZY Algo ------------------------------------------------- init 131.759 66.916 main 83.688 40.861 sig 98.348 39.699 index 109.222 30.738 ab 72.222 44.357 cd 83.036 54.739 a 58.94 62.242 b 43.612 43.442 c 64.39 67.442 k 40.585 36.371 z 34.708 22.781 w 38.033 30.109 cpa 82.596 38.116 arz 84.251 23.964 zzzz 35.823 22.75 dimag 110.686 29.646 xa 43.188 29.199 nha 73.953 31.001 nedax 94.775 29.568 dbue 79.846 25.902 fp 46.826 31.641 tr 90.951 55.883 kw 38.875 23.194 rp 101.575 55.775 kkkkkkkkkkkkkkkkkkkkkkkkkkkkk 48.519 30.921 ``` ```vim vim9script var haystack = readfile('/Users/gp/linux.files') var needles = ['init', 'main', 'sig', 'index', 'ab', 'cd', 'a', 'b', 'c', 'k', 'z', 'w', 'cpa', 'arz', 'zzzz', 'dimag', 'xa', 'nha', 'nedax', 'dbue', 'fp', 'tr', 'kw', 'rp', 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkk'] for needle in needles var start = reltime() var tmp = matchfuzzy(haystack, needle) echom $'{needle}' (start->reltime()->reltimefloat() * 1000) endfor ``` Additional changes * Removed the "camelcase" option from both matchfuzzy() and matchfuzzypos(), as it's now obsolete with the improved algorithm. related: neovim/neovim#34101 fixes vim/vim#17531 closes: vim/vim#17900 https://github.com/vim/vim/commit/7e0df5eee9eab872261fd5eb0068cec967a2ba77 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-08vim-patch:9.1.1605: cannot specify scope for chdir() (#35239)zeertzjq1
Problem: Cannot specify scope for chdir() Solution: Add optional scope argument (kuuote) closes: vim/vim#17888 https://github.com/vim/vim/commit/8a65a49d509d5a9dd5759a4287969896e8941c10 Co-authored-by: kuuote <znmxodq1@gmail.com>
2025-08-08vim-patch:d82c918: runtime(doc): Improve doc for cmdline-autocomplete (#35235)zeertzjq1
Maybe this was unnecessary, but saw this: https://github.com/vim/vim/issues/17854 https://github.com/vim/vim/commit/d82c918e2f3e6af65c36fb14457968053dcc03a3 Co-authored-by: Girish Palya <girishji@gmail.com>