aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/errors.h
Commit message (Collapse)AuthorAge
* vim-patch:9.2.0379: gui.color_approx is never used (#41951)Jan Edmund Lazo2026-09-17
| | | | | | | | | | | | | | | | | | Problem: gui.color_approx in gui_T has not been assigned anywhere since patch 7.4.2094 ("The color allocation in X11 is overly complicated", 2016), which dropped the single "gui.color_approx = TRUE;" site. Because the member is zero-initialized and never written, the check "if (gui.color_approx)" in gui_mch_init() is always false and the "E458: Cannot allocate colormap entry, ..." warning can never be emitted. Solution: Remove the struct member and the unreachable branch. The E458 error definition is removed. Update the example error code "E458" in the ex_eval.c comment to "E457" accordingly. closes: vim/vim#20007 https://github.com/vim/vim/commit/fe3c27ce0b7b889a2ae29833cae55ca92ae86518 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* fix(cmdwin): allow a user to switch to other buffers #41199Rob Pilling2026-08-28
|
* vim-patch:9.0.0885: informational message has an error message numberJan Edmund Lazo2026-08-17
| | | | | | | | | Problem: Informational message has an error message number. Solution: Use a message without an error number. (closes vim/vim#11530) https://github.com/vim/vim/commit/b53a190e9f8a767bbd4be2f538649a09f9c8ba4b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.2.0815: deeply nested regexp patterns may cause stack overflow ↵zeertzjq2026-07-21
| | | | | | | | | | | | | | (#40878) Problem: Deeply nested regexp groups can cause uncontrolled recursion in the regexp compiler and exhaust the C stack. Solution: Limit recursive regexp parsing depth in both the backtracking and NFA compilers (lipengyu) closes: vim/vim#20731 https://github.com/vim/vim/commit/a79cd6bfc3e85e1d9f1ec48eda76c7385b44bf69 Co-authored-by: lipengyu <lipengyu@kylinos.cn>
* feat(ui): ":%detach!" detaches all other UIs #39216Jason Woodland2026-07-17
| | | | | | | Problem: Not easy for one UI to kick the others off a shared Nvim server. Solution: Treat `:%detach` as detach-other-UIs.
* fix(restart): messages EXX error codes #40759Olivia Kinnear2026-07-17
|
* fix(messages): show hint in E77 error #40765Curnic Dorin2026-07-16
|
* fix(autocmd): safely parse buflocal buffer numbers (#40436)Muhammad Arrafif Prikusuma2026-06-28
| | | | | | | | | | | | | | | | | | | | | | * refactor(autocmd): safely parse buflocal buffer numbers Replace unsafe atoi with a robust integer conversion when extracting the buffer number out of a "<buffer=123>" pattern in aupat\_get\_buflocal\_nr. This prevents potential silent integer overflows and ensures variables fit safely within INT\_MAX boundaries before truncation. * fix(autocmd): use getdigits_int to safely parse buffer numbers * fix(autocmd): raise error for invalid buffer-local pattern values When defining an autocommand, an invalid buffer-local pattern format (such as `<buffer=foo>` or `<buffer=0>`) would previously fall through silently and default to a generic `<buffer>` tag behavior. Fix this regression by trapping invalid buffer numbers early from `aupat_get_buflocal_nr()` and throwing a proper E680 error to match Vim's runtime validation behavior.
* vim-patch:9.2.0524: spell: buffer overflow with many affix or compound flagszeertzjq2026-05-24
| | | | | | | | | | | | | Problem: spell: a word in a .dic file with many postponed prefix or compound flags overflows the fixed-size store_afflist[MAXWLEN] buffer in get_pfxlist() and get_compflags(). Solution: Add bounds checks (Yasuhiro Matsumoto). closes: vim/vim#20286 https://github.com/vim/vim/commit/9a920e82546dace49a0a88dced80d29a39efbdb0 Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
* vim-patch:9.2.0458: Crash with invalid shellredir/shellpipe value (#39691)zeertzjq2026-05-09
| | | | | | | | | | | | Problem: Crash with invalid shellredir/shellpipe value (bfredl) Solution: Validate the option and allow only a single "%s". fixes: vim/vim#20157 closes: vim/vim#20159 https://github.com/vim/vim/commit/84ae09dd79b9888ba71dc2a28f9afcac3e7b8901 Co-authored-by: Christian Brabandt <cb@256bit.org>
* revert: "vim-patch:9.2.0405: when jumping to tags, will open URLs (#39461)" ↵zeertzjq2026-04-28
| | | | | | | (#39487) This reverts commit 72bc6c5801867e8f99a87737a64c1713ceac1e01. Fix #39480
* vim-patch:9.2.0405: when jumping to tags, will open URLs (#39461)zeertzjq2026-04-28
| | | | | | | | | | | | | Problem: when jumping to tags, will open URLs (Srinivas Piskala Ganesh Babu) Solution: Disallow trying to open remote files. closes: vim/vim#20068 Supported by AI https://github.com/vim/vim/commit/ae196b2d589562fbb3fcd64cd0cc33f052c6cf56 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(substitute): don't crash with very large count (#39272)zeertzjq2026-04-21
|
* refactor: move e_invalwindow to errors.h (#39067)glepnir2026-04-15
| | | | | Problem: e_invalwindow was a static local, inconsistent with other error strings. Solution: Convert it to EXTERN/INIT style and move it to errors.h.
* fix(help): show error when using :help! with nothing at cursor #38775zeertzjq2026-04-05
| | | | It's possible to still show the old Easter egg, but then the user won't know about the new feature, so showing E349 is better.
* vim-patch:9.2.0088: cannot display tabs for indentationzeertzjq2026-03-03
| | | | | | | | | | | | | Problem: cannot display tabs for indentation Solution: Add the "leadtab" value to the 'listchars' option to distinguish between tabs used for indentation and tabs used for alignment (HarshK97). closes: vim/vim#19094 https://github.com/vim/vim/commit/8526d32647245b3b623986949e7807b4b353e624 Co-authored-by: HarshK97 <harshkapse1234@gmail.com>
* vim-patch:9.2.0031: Inefficient use of ga_concat()zeertzjq2026-02-22
| | | | | | | | | | | | | Problem: Inefficient use of ga_concat() Solution: Use ga_concat_len() when the length is already known to avoid use of strlen() (John Marriott). closes: vim/vim#19422 https://github.com/vim/vim/commit/ed202035b1904c84d92adb76d7e1a95b7540e048 Co-authored-by: John Marriott <basilisk@internode.on.net> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:9.1.1954: Setting a byte in a blob, accepts values outside 0-255zeertzjq2026-02-16
| | | | | | | | | | | | Problem: Setting a byte in a blob, accepts values outside 0-255 Solution: When setting a byte in a blob, check for valid values (Yegappan Lakshmanan) closes: vim/vim#18870 https://github.com/vim/vim/commit/f4a299700e211a728f0f7398eb8fceaf44165711 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.3841: Vim9: outdated TODO items, disabled tests that work (#37900)zeertzjq2026-02-16
| | | | | | | | | Problem: Vim9: outdated TODO items, disabled tests that work. Solution: Remove TODO items, run tests that work now. Check that a dict item isn't locked. https://github.com/vim/vim/commit/71b768509250b12696e8cc90e5902029f1b5433d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge #37424 $XDG_CONFIG_DIRS with init.lua, $NVIM_APPNAMEJustin M. Keyes2026-02-06
|\
| * refactor(startup): extract conflicting configs error to errors.hJesse van der Pluijm2026-02-06
| | | | | | | | | | | | | | | | | | | | Problem: The E5422 error message was duplicated in two places in main.c, and hardcoded error strings should be centralized in errors.h for consistency. Solution: Add e_conflicting_configs to errors.h and replace both inline error strings with the centralized constant.
* | vim-patch:9.0.0874: using freed memory when executing unmenu at more promptzeertzjq2026-01-24
|/ | | | | | | | | Problem: Using freed memory when executing unmenu at the more prompt. Solution: Do not clear menus while listing them. (closes vim/vim#11439) https://github.com/vim/vim/commit/920d311480114274e4d73156edf4b49ba0b712dd Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:9.0.0907: restoring window after WinScrolled may failzeertzjq2026-01-14
| | | | | | | | | | | | | Problem: Restoring window after WinScrolled may fail. Solution: Lock the window layout when triggering WinScrolled. https://github.com/vim/vim/commit/d63a85592cef0ee4f0fec5efe2f8d66b31f01f05 Only check close_disallowed in window_layout_locked() for now. Also don't check window_layout_locked() when closing a floating window, as it's not checked when creating a floating window. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.2066: :wqall! doesn't close a terminal like :qall! does (#37314)zeertzjq2026-01-08
| | | | | | | | | | | | | Problem: :wqall! doesn't close a terminal buffer like :qall! does (after 8.0.1525). Solution: Check eap->forceit (zeertzjq). Ref: https://github.com/vim/vim/issues/2654#issuecomment-366803932 related: vim/vim#2654 related: neovim/neovim#14061 closes: vim/vim#19129 https://github.com/vim/vim/commit/d8558fdf4f2758163218289637e82c3ae2d617ec
* vim-patch:8.1.0753: printf format not checked for semsg() (#37248)zeertzjq2026-01-05
| | | | | | | | | | | Problem: printf format not checked for semsg(). Solution: Add GNUC attribute and fix reported problems. (Dominique Pelle, closes vim/vim#3805) https://github.com/vim/vim/commit/b5443cc46dd1485d6c785dd8c65a2c07bd5a17f3 Cherry-pick a change from patch 8.2.3830. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.1963: diff: missing diff size limit for xdiff (#36877)zeertzjq2025-12-09
| | | | | | | | | | | | | | | | | | | | | | | Problem: diff: missing diff size limit for xdiff Solution: Impose file size limit for internal diff (xdiff) (Yee Cheng Chin). Git imposes a hard cap on file size for content that it passes to xdiff (added to Git in dcd1742e56e, defined in xdiff-interface.h), due to integer overflow concerns in xdiff. Vim doesn't specify such a limit right now, which means it's possible for a user to diff a large file (1GB+) and trigger these overflow issues. Add the same size limit (1GB minus 1MB) to Vim and simply throws an error when Vim encounters files larger than said limit. For now, reuse the same error message regarding internal diff failures. There is no need to add the same limit for external diff as it's up to each tool to error check their input to decide what is appropriate or not. closes: vim/vim#18891 https://github.com/vim/vim/commit/4af6d9755cba0dd07e881172f2a6e0efe9986ddc Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:8.2.2423: missing error messageJan Edmund Lazo2025-10-13
| | | | | | | | | Problem: Missing error message. Solution: Add the error message. https://github.com/vim/vim/commit/61015162ba834541c42da5db6f3fa0ebe1d40e87 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3968: build failureJan Edmund Lazo2025-10-12
| | | | | | | | | Problem: Build failure. Solution: Add missing changes. https://github.com/vim/vim/commit/e70cec976026ce72d09b6589ebba4677581063ac Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3962: build fails for missing error messageJan Edmund Lazo2025-10-12
| | | | | | | | | Problem: Build fails for missing error message. Solution: Add changes in missed file. https://github.com/vim/vim/commit/d0819d11ecdf3bca4b0800ef905091b5e175b6f4 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4772: old Coverity warning for not checking ftell() return valueJan Edmund Lazo2025-10-10
| | | | | | | | | Problem: Old Coverity warning for not checking ftell() return value. Solution: Check return value of fseek() and ftell(). https://github.com/vim/vim/commit/3df8f6e353eeaf24bb5fe3769ed07c03791bb58e Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.1.1981: the evalfunc.c file is too bigJan Edmund Lazo2025-10-06
| | | | | | | | | | Problem: The evalfunc.c file is too big. Solution: Move undo functions to undo.c. Move cmdline functions to ex_getln.c. Move some container functions to list.c. https://github.com/vim/vim/commit/08c308aeb5e7dfa18fa61f261b0bff79517a4883 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.1600: using diff anchors with hidden buffers fails silently ↵zeertzjq2025-08-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | (#35218) Problem: diff: using diff anchors with hidden buffers fails silently Solution: Give specific error message for diff anchors when using hidden buffers (Yee Cheng Chin). Diff anchors currently will fail to parse if a buffer used for diff'ing is hidden. Previously it would just fail as the code assumes it would not happen normally, but this is actually possible to do if `closeoff` and `hideoff` are not set in diffopt. Git's default diff tool "vimdiff3" also takes advantage of this. This fix this properly would require the `{address}` parser to be smarter about whether a particular address relies on window position or not (e.g. the `'.` address requires an active window, but `'a` or `1234` do not). Since hidden diff buffers seem relatively niche, just provide a better error message / documentation for now. This could be improved later if there's a demand for it. related: vim/vim#17615 closes: vim/vim#17904 https://github.com/vim/vim/commit/cad3b2421de7b703e0ee619850a8a3bc55454281 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.1.1557: not possible to anchor specific lines in diff mode (#34967)zeertzjq2025-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: not possible to anchor specific lines in diff mode Solution: Add support for the anchoring lines in diff mode using the 'diffanchor' option (Yee Cheng Chin). Adds support for anchoring specific lines to each other while viewing a diff. While lines are anchored, they are guaranteed to be aligned to each other in a diff view, allowing the user to control and inform the diff algorithm what the desired alignment is. Internally, this is done by splitting up the buffer at each anchor and run the diff algorithm on each split section separately, and then merge the results back for a logically consistent diff result. To do this, add a new "diffanchors" option that takes a list of `{address}`, and a new "diffopt" option value "anchor". Each address specified will be an anchor, and the user can choose to use any type of address, including marks, line numbers, or pattern search. Anchors are sorted by line number in each file, and it's possible to have multiple anchors on the same line (this is useful when doing multi-buffer diff). Update documentation to provide examples. This is similar to Git diff's `--anchored` flag. Other diff tools like Meld/Araxis Merge also have similar features (called "synchronization points" or "synchronization links"). We are not using Git/Xdiff's `--anchored` implementation here because it has a very limited API (it requires usage of the Patience algorithm, and can only anchor unique lines that are the same across both files). Because the user could anchor anywhere, diff anchors could result in adjacent diff blocks (one block is directly touching another without a gap), if there is a change right above the anchor point. We don't want to merge these diff blocks because we want to line up the change at the anchor. Adjacent diff blocks were first allowed when linematch was added, but the existing code had a lot of branched paths where line-matched diff blocks were handled differently. As a part of this change, refactor them to have a more unified code path that is generalized enough to handle adjacent diff blocks correctly and without needing to carve in exceptions all over the place. closes: vim/vim#17615 https://github.com/vim/vim/commit/0d9160e11ce4b921adff1e5621dd989ce96fb0f3 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.1.1361: [security]: possible use-after-free when closing a ↵Sean Dewar2025-05-04
| | | | | | | | | | | | | | | | | buffer (#33820) Problem: [security]: Possible to open more windows into a closing buffer without splitting, bypassing existing "b_locked_split" checks and triggering use-after-free Solution: Disallow switching to a closing buffer. Editing a closing buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an error message and check just "b_locked_split", as "b_locked" is necessary only when the buffer shouldn't be wiped, and may be set for buffers that are in-use but not actually closing. (Sean Dewar) closes: vim/vim#17246 https://github.com/vim/vim/commit/6cb1c828406dcbb9b67ee788501b94f3a0bac88a
* vim-patch:9.1.1013: Vim9: Regression caused by patch v9.1.0646zeertzjq2025-01-16
| | | | | | | | | | | | | | | | Problem: Vim9: Regression caused by patch v9.1.0646 Solution: Translate the function name before invoking it in call() (Yegappan Lakshmanan) fixes: vim/vim#16430 closes: vim/vim#16445 https://github.com/vim/vim/commit/6289f9159102e0855bedc566636b5e7ca6ced72c N/A patch: vim-patch:8.2.4176: Vim9: cannot use imported function with call() Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(messages)!: vim.ui_attach message callbacks are unsafeLuuk van Baal2024-11-14
| | | | | | | | Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are executed when it is not safe. Solution: Disallow non-fast API calls for "msg_show" event callbacks. Automatically detach callback after excessive errors. Make sure fast APIs do not modify Nvim state.
* vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058)zeertzjq2024-11-03
| | | | | | | | | | | | | Problem: 'findexpr' can't be used for lambads (Justin Keyes) Solution: Replace the findexpr option with the findfunc option (Yegappan Lakshmanan) related: vim/vim#15905 closes: vim/vim#15976 https://github.com/vim/vim/commit/a13f3a4f5de9c150f70298850e34747838904995 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline ↵zeertzjq2024-10-29
| | | | | | | | | | | argument Problem: 'findexpr' completion doesn't set v:fname to cmdline argument. Solution: Set v:fname to the cmdline argument as-is (zeertzjq). closes: vim/vim#15934 https://github.com/vim/vim/commit/20e045f78148c0ef0143c33ffe686fee72d29376
* vim-patch:9.1.0811: :find expansion does not consider 'findexpr'zeertzjq2024-10-29
| | | | | | | | | | | | Problem: :find expansion does not consider 'findexpr' Solution: Support expanding :find command argument using 'findexpr' (Yegappan Lakshmanan) closes: vim/vim#15929 https://github.com/vim/vim/commit/2f6efaccfd5c4e7df1f54ed0f41f329abbe05f60 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.0810: cannot easily adjust the |:find| commandzeertzjq2024-10-29
| | | | | | | | | | | | Problem: cannot easily adjust the |:find| command Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan) closes: vim/vim#15901 closes: vim/vim#15905 https://github.com/vim/vim/commit/aeb1c97db5b9de4f4903e7f288f2aa5ad6c49440 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* refactor: move shared messages to errors.h #26214Justin M. Keyes2024-06-01