summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/normal.c
AgeCommit message (Collapse)AuthorFiles
2026-04-22vim-patch:9.2.0385: Integer overflow with "ze" and large 'sidescrolloff' ↵zeertzjq1
(#39289) Problem: Integer overflow with "ze" and large 'sidescrolloff'. Solution: Check for overflow to avoid negative w_leftcol (zeertzjq). closes: vim/vim#20026 https://github.com/vim/vim/commit/33f3965087b01dccf4382ed419d34799ffd66cd9
2026-04-21feat(normal): normal-mode ZR does :restartJustin M. Keyes1
Make it a normal-mode command instead of a default mapping.
2026-04-21fix(move): avoid integer overflow with large 'scrolloff' (#39251)zeertzjq1
2026-04-12fix(normal): pass count to 'keywordprg' as arg1 #38965Barrett Ruth1
Problem: If `'keywordprg'` begins with `:`, `3K` turns the count into an Ex range. Commands that don't support that then fail. Vim passes the count as the first arg (see #19436, vim/vim#10745). Solution: Pass `[count]` as the first arg for `'keywordprg'`.
2026-04-05fix(help): show error when using :help! with nothing at cursor #38775zeertzjq1
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.
2026-04-04vim-patch:9.2.0295: 'showcmd' shows wrong Visual block size with 'linebreak' ↵zeertzjq1
(#38756) Problem: 'showcmd' shows wrong Visual block size with 'linebreak' after end char (after 7.4.467). Solution: Exclude 'linebreak' from end position. Also fix confusing test function names. closes: vim/vim#19908 https://github.com/vim/vim/commit/08bd9114c17e1dc8fb234cd5362e77db8be3aad5
2026-04-04vim-patch:9.2.0289: 'linebreak' may lead to wrong Visual block highlighting ↵zeertzjq1
(#38749) Problem: 'linebreak' may lead to wrong Visual block highlighting when end char occupies multiple cells (after 7.4.467). Solution: Exclude 'linebreak' from the ending column instead of setting 'virtualedit' temporarily (zeertzjq). fixes: vim/vim#19898 closes: vim/vim#19900 https://github.com/vim/vim/commit/23be1889d1a1212445ca8bb9cd378484d3755f79
2026-03-15feat(help): super K (":help!") guesses tag at cursor #36205Justin M. Keyes1
Problem: `K` in help files may fail in some noisy text. Example: (`fun(config: vim.lsp.ClientConfig): boolean`) ^cursor Solution: - `:help!` (bang, no args) activates DWIM behavior: tries `<cWORD>`, then trims punctuation until a valid tag is found. - Set `keywordprg=:help!` by default. - Does not affect `CTRL-]`, that is still fully "tags" based.
2026-03-13fix(normal): crash using :norm from vim.ui_attach shell message event #38283luukvbaal1
Problem: 'showcmd' buffer is being populated for :norm commands, which can result in a recursive uv_run() when called from a msg_show vim.ui_attach callback for a shell message. Solution: The 'showcmd' buffer is never displayed while executing a :normal command so prevent unnecessary work, avoiding the crash.
2026-03-12docs: miscJustin M. Keyes1
2026-03-10Merge #37926 msg_show UI event indicates user-interactiveJustin M. Keyes1
2026-03-10vim-patch:partial:9.2.0126: String handling can be improved (#38214)zeertzjq1
Problem: String handling can be improved Solution: Pass string length where it is known to avoid strlen() calls, do a few minor refactors (John Marriott). This commit changes some calls to function `set_vim_var_string()` to pass the string length where it is known or can be easily calculated. In addition: In `evalvars.c`: * In function `set_reg_var()` turn variable `regname` into a C string because that is how it used. * Small cosmetics. In `option.c`: * Slightly refactor function `apply_optionset_autocmd()` to move some variables closer to where they are used. In `getchar.c`: * Slightly refactor function `do_key_input_pre()`: -> change call to `dict_add_string()` to `dict_add_string_len()` and pass it the length of `buf`. -> only call `get_vim_var_string()` once. In `message.c`: * Use a `string_T` to store local variable `p`. In `normal.c`: * Move some variables closer to where they are used. closes: vim/vim#19618 https://github.com/vim/vim/commit/727f6e2686fb1d06b9591e6de689763a479cc664 Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-03-03feat(ui): specify whether msg_show event comes from typed commandLuuk van Baal1
Problem: Unable to tell whether a msg_show event is emitted as a result a command typed on the cmdline (UI may want to represent these differently from other messages). Solution: Add trigger parameter that is set to "typed_cmd" for a message emitted due to an interactively typed command. Possible extensions are mapping/timer/event but it's hard to imagine a UI distinguishing those so not added here.
2026-02-23feat(messages): drop hardcoded 'showmode' delay #38029Justin M. Keyes1
Problem: - Editing a 'readonly' file forces a 3-second delay. - nvim_get_mode waits 3 secs with 'showmode' enabled or when there are error messages. Solution: Remove the delay for "ui2", by using `msg_delay`.
2026-02-21fix(messages): reinstate 'showmode' message delay #37992luukvbaal1
Problem: 94c21c2 erroneously removed message delay without ext_messages. Solution: Remove delay with ext_messages as intended.
2026-02-14fix(terminal): missing refresh with partial mappings (#37839)zeertzjq1
Problem: Terminal buffers are not refreshed when processing keys that trigger partial mappings. Solution: Process due terminal refreshes before redrawing.
2026-01-30fix(prompt): also store column info in ': mark #36194Shadman1
Problem: Currently, : mark is set in start of prompt-line. But more relevant location is where the user text starts. Solution: Store and update column info on ': just like the line info
2026-01-18fix(normal): assertion failure with "gk" in narrow window (#37444)zeertzjq1
When width1 and width2 are negative the assertion may fail. It seems that adding a negative value to w_curswant won't cause any problems, so just change the assertion.
2026-01-01vim-patch:8.2.2198: ml_get error when resizing window and using text propertyJan Edmund Lazo1
Problem: ml_get error when resizing window and using text property. Solution: Validate botline of the right window. (closes vim/vim#7528) https://github.com/vim/vim/commit/23999d799cfe844b604f193183f8f84052c8e746 Migrate to Vim's (in)validate_botline_win() API. Nvim wants to pass "curwin" instead of hiding them behind alias/macro/inline-function. https://github.com/neovim/neovim/pull/37164#discussion_r2655006908 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-20refactor(messages): encapsulate msg_delay logicJustin M. Keyes1
see also 9bbbeb60e355844780db0aef955e860d68ac0342
2025-12-20test(messages): skip os_delay during testsJustin M. Keyes1
Problem: Tests that trigger `os_delay` messages may take 1-3 seconds, wasting build/CI time, since this serves no purpose in tests. Solution: - Introduce `msg_delay` for cases where `os_delay` is being used as a "UI feature". - Skip `msg_delay` in tests.
2025-11-20fix(input): discard following keys when discarding <Cmd>/K_LUA (#36498)zeertzjq1
Technically the current behavior does match documentation. However, the keys following <Cmd>/K_LUA aren't normally received by vim.on_key() callbacks either, so it does makes sense to discard them along with the preceding key. One may also argue that vim.on_key() callbacks should instead receive the following keys together with the <Cmd>/K_LUA, but doing that may cause some performance problems, and even in that case the keys should still be discarded together.
2025-11-01vim-patch:9.1.1891: g<End> does not move to last non-blank in visual mode ↵varsidry1
(#36354) Problem: In visual mode, g<End> does not move to the last non-blank character when the end of a line is on the same line as the cursor (after v9.0.1753) Solution: Move the cursor back by one position if it lands after the line (varsidry) fixes: vim/vim#18657 closes: vim/vim#18658 https://github.com/vim/vim/commit/adc85151f3c6a6cea4bb8c8da3465429fc120445
2025-10-18vim-patch:9.1.1868: v:register is wrong in v_: command (#36238)zeertzjq1
Problem: v:register is wrong in v_: command (after 9.1.1858). Solution: Don't reset v:register for OP_COLON (zeertzjq) related: https://github.com/vim/vim/pull/18583#issuecomment-3418030021 closes: vim/vim#18597 https://github.com/vim/vim/commit/0124320c97b0fbbb44613f42fc1c34fee6181fc8 While at it, also fix using stale set_prevcount value. That only matters when readbuf1 ends with an operator or a register, which never happens, but it's still good to avoid using a stale value.
2025-10-17vim-patch:9.1.1858: v:register not reset after Visual mode command (#36215)zeertzjq1
Problem: v:register not reset after Visual mode command. (laktak) Solution: Reset v:register if Visual mode was active before do_pending_operator() (zeertzjq) fixes: vim/vim#18579 related: vim/vim#5305 closes: vim/vim#18583 https://github.com/vim/vim/commit/b3b47e540d35742503ea372c5a97e8fb5681ab26
2025-10-04vim-patch:partial:8.1.1939: code for handling v: variables in generic eval ↵Jan Edmund Lazo1
file (#35968) Problem: Code for handling v: variables in generic eval file. Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan, closes vim/vim#4872) https://github.com/vim/vim/commit/e5cdf153bcb348c68011b308c8988cea42d6ddeb Remove direct reference to "vimvars" for following functions: - assert_error() - get_vim_var_nr() - get_vim_var_list() - get_vim_var_dict() - get_vim_var_str() - set_cmdarg() - set_reg_var() - set_vcount() - set_vexception() - set_vthrowpoint() - set_vim_var_bool() - set_vim_var_dict() - set_vim_var_list() - set_vim_var_nr() - set_vim_var_special() - set_vim_var_string() - set_vim_var_type() Reorder functions based on v8.2.4930 for eval_one_expr_in_str() and eval_all_expr_in_str(). Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-26vim-patch:8.1.2077: the ops.c file is too bigJan Edmund Lazo1
Problem: The ops.c file is too big. Solution: Move code for dealing with registers to a new file. (Yegappan Lakshmanan, closes vim/vim#4982) https://github.com/vim/vim/commit/4aea03eb875613e3eae2125b84f02b7cd898b2f8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20vim-patch:8.2.0853: ml_delete() often called with FALSE argumentJan Edmund Lazo1
Problem: ml_delete() often called with FALSE argument. Solution: Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE. https://github.com/vim/vim/commit/ca70c07b72c24aae3d141e67d08f50361f051af5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2025-08-13vim-patch:9.1.1625: Autocompletion slow with include- and tag-completion ↵zeertzjq1
(#35318) Problem: Autocompletion slow with include- and tag-completion Solution: Refactor ins_compl_interrupted() to also check for timeout, further refactor code to skip outputting message when performing autocompletion (Girish Palya). Running `vim *` in `vim/src` was slower than expected when 'autocomplete' was enabled. Include-file and tag-file completion sources were not subject to the timeout check, causing unnecessary delays. So apply the timeout check to these sources as well, improving autocompletion responsiveness, refactor find_pattern_in_path() to take an additional "silent" argument, to suppress any messages. closes: vim/vim#17966 https://github.com/vim/vim/commit/59e1d7f353993e93be97dbec30d3218742960f62 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-25fix(ui)!: decouple ext_messages from message grid #27963luukvbaal1
Problem: ext_messages is implemented to mimic the message grid implementation w.r.t. scrolling messages, clearing scrolled messages, hit-enter-prompts and replacing a previous message. Meanwhile, an ext_messages UI may not be implemented in a way where these events are wanted. Moreover, correctness of these events even assuming a "scrolled message" implementation depends on fragile "currently visible messages" global state, which already isn't correct after a previous message was supposed to have been overwritten (because that should not only happen when `msg_scroll == false`). Solution: - No longer attempt to keep track of the currently visible messages: remove the `msg_ext(_history)_visible` variables. UIs may remove messages pre-emptively (timer based), or never show messages that don't fit a certain area in the first place. - No longer emit the `msg(_history)_clear` events to clear "scrolled" messages. This opens up the `msg_clear` event to be emitted when messages should actually be cleared (e.g. when the screen is cleared). May also be useful to emit before the first message in an event loop cycle as a hint to the UI that it is a new batch of messages (vim._extui currently schedules an event to determine that). - Set `replace_last` explicitly at the few callsites that want this to be set to true to replace an incomplete status message. - Don't store a "keep" message to be re-emitted.
2025-06-24feat(prompt): prompt_getinput() gets current input #34491Shadman1
Problem: Not easy to get user-input in prompt-buffer before the user submits the input. Under the current system user/plugin needs to read the buffer contents, figure out where the prompt is, then extract the text. Solution: - Add prompt_getinput(). - Extract prompt text extraction logic to a separate function
2025-06-17feat(prompt): multiline prompt input #33371Shadman1
Problem: Cannot enter multiline prompts in a buftype=prompt buffer. Solution: - Support shift+enter (`<s-enter>`) to start a new line in the prompt. - Pasting multiline text via OS paste, clipboard, "xp, etc. - A/I in editable region works as usual. - i/a/A/I outside of editable region moves cursor to end of current prompt. - Support undo/redo in prompt buffer. - Support o/O in prompt buffer. - Expose prompt location as `':` mark.
2025-06-17vim-patch:9.1.1464: gv does not work in operator-pending mode (#34534)zeertzjq1
Problem: gv does not work in operator-pending mode (liushapku) Solution: remove the check for checkclearop in nv_gv_cmd() (phanium) fixes: vim/vim#3666 closes: vim/vim#17551 https://github.com/vim/vim/commit/cb27992cdadd3a17a9094096f0972fa806f0240d Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-05-02vim-patch:9.1.1357: Vim incorrectly escapes tags with "[" in a help bufferbrianhuster1
Problem: Vim incorrectly escapes tags containing "[" in a help buffer Solution: check if the buffer has the "help" filetype set, instead of already being a help buffer (Phạm Bình An) fixes: vim/vim#17224 closes: vim/vim#17232 https://github.com/vim/vim/commit/6af20a9be3312045c38ca24b93f2d5d0d70da0b1 Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com> Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-04-29feat(ui): no delay for errors with ext_messages (#33693)luukvbaal1
Problem: Delay for reading a message may be unwanted for ext_messages, and can be done by the implementation. Empty completion source error message is not distinguishable as such. Solution: Only delay without ext_messages enabled. Emit empty completion source message as an error.
2025-04-28refactor(ui): separate types for allocated grids and viewportsbfredl1
2025-04-19vim-patch:9.1.1319: Various typos in the code, issue with ↵zeertzjq1
test_inst_complete.vim (#33527) Problem: Various typos in the code, redundant and strange use of :execute in test_ins_complete.vim (after 9.1.1315). Solution: Fix typos in the code and in the documentation, use the executed command directly (zeertzjq). closes: vim/vim#17143 https://github.com/vim/vim/commit/98800979dc109e03f390a0472b14ed89189e02fe Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2025-03-06vim-patch:9.1.1175: inconsistent behaviour with exclusive selection and ↵zeertzjq1
motion commands (#32745) Problem: inconsistent behaviour with exclusive selection and motion commands (aidancz) Solution: adjust cursor position when selection is exclusive (Jim Zhou) fixes: vim/vim#16278 closes: vim/vim#16784 https://github.com/vim/vim/commit/c8cce711dde2d8abcf0929b3b12c4bfc5547a89d Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-02-25feat(marks): add conceal_lines to nvim_buf_set_extmark()Luuk van Baal1
Implement an extmark property that conceals lines vertically.
2025-02-13vim-patch:9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol" (#32434)zeertzjq1
Problem: 'smoothscroll' gets stuck with 'listchars' "eol". Solution: Count size of 'listchars' "eol" in line size when scrolling. (zeertzjq) related: neovim/neovim#32405 closes: vim/vim#16627 https://github.com/vim/vim/commit/2c47ab8fcd7188fa87053c757ea86b0d846c06c1
2025-01-30docs: miscdundargoc1
Co-authored-by: Dustin S. <dstackmasta27@gmail.com> Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: brianhuster <phambinhanctb2004@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-12-23refactor: iwyu #31637Justin M. Keyes1
Result of `make iwyu` (after some "fixups").
2024-12-17vim-patch:9.1.0938: exclusive selection not respected when re-selecting ↵zeertzjq1
block mode (#31603) Problem: exclusive selection not respected when re-selecting block mode (Matt Ellis) Solution: advance selection by another character when using selection=exclusive and visual block mode fixes: vim/vim#16202 closes: vim/vim#16219 https://github.com/vim/vim/commit/bb955894734b287abfadd3a25786a42038d18d61 Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-10fix(ui): update title in more cases (#31508)zeertzjq1
2024-12-07vim-patch:9.1.0908: not possible to configure :messages (#31492)zeertzjq1
Problem: not possible to configure :messages Solution: add the 'messagesopt' option (Shougo Matsushita) closes: vim/vim#16068 https://github.com/vim/vim/commit/51d4d84d6a7159c6ce9e04b36f8edc105ca3794b Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: h_east <h.east.727@gmail.com>
2024-11-23refactor(options): autogenerate valid values and flag enums for options (#31089)Famiu Haque1
Problem: Option metadata like list of valid values for an option and option flags are not listed in the `options.lua` file and are instead manually defined in C, which means option metadata is split between several places. Solution: Put metadata such as list of valid values for an option and option flags in `options.lua`, and autogenerate the corresponding C variables and enums. Supersedes #28659 Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-18vim-patch:9.1.0869: Problem: curswant not set on gm in folded line (#31247)zeertzjq1
Problem: curswant not set on gm in folded line (citizenmatt) Solution: in a folded line, call update_curswant_force() fixes: vim/vim#11596 closes: vim/vim#11994 closes: vim/vim#15398 https://github.com/vim/vim/commit/9848face747ba91282d34a96dcb966bcb410bf2b Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-09feat(ext_messages): add hl_id to ext_messages chunksLuuk van Baal1
Problem: Ext_messages chunks only contain the highlight attr id, which is not very useful for vim.ui_attach() consumers. Solotion: Add highlight group id to message chunks, which can easily be used to highlight text in the TUI through nvim_buf_set_extmark(): hl_group = synIDattr(id, "name").
2024-11-08refactor(message): propagate highlight id instead of attrsLuuk van Baal1
Problem: Highlight group id is not propagated to the end of the message call stack, where ext_messages are emitted. Solution: Refactor message functions to pass along highlight group id instead of attr id.