aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* fix(marks): issues with invalid marks and marks beyond eob (#32862)luukvbaal2025-03-16
| | | | | | | Problem: Marks that go beyond the end of the buffer, and paired marks whose end is in front of its start mark are added to and removed from the decor. This results in incorrect tracking of the signcolumn. Solution: Ensure such marks are not added to and removed from the decor.
* refactor(tui): disable kitty key event reportingGregory Anders2025-03-16
| | | | | Temporary measure for the stable release. Re-enable for nightly after 0.11 release.
* fix(statuscolumn): misleading v:lnum for virtual lines #32912luukvbaal2025-03-15
| | | | | | | Problem: Virtual 'statuscolumn' lines are evaluated with a misleading v:(rel)num. Namely set to the line above for `virt_lines_above = true` lines, or even the last drawn line for a partial redraw. Solution: Set `v:lnum` for the first evaluated row of a line, first above virtual line of a row and first non-virtual line of a row.
* docs: miscdundargoc2025-03-15
| | | | | | | | | | | | | Co-authored-by: Au. <acehinnnqru@gmail.com> Co-authored-by: Daniel Rainer <daniel.rainer@localhost> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Luuk van Baal <luukvbaal@gmail.com> Co-authored-by: Pierre Barbin <pierre@heitzsystem.com> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com> Co-authored-by: phanium <91544758+phanen@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(defaults): completeopt=popup #32909Justin M. Keyes2025-03-15
| | | | Assuming that completeopt=popup does what its documentation claims, it is more appropriate that completeopt=preview as a default.
* fix(cmdline): ext_cmdline block events for conditionalsLuuk van Baal2025-03-15
| | | | | | Problem: No block events emitted with ext_cmdline for :if, :while, :try etc. Solution: Emit cmdline block events; store the indent level of the previous cmdline and whether a block event was emitted.
* vim-patch:9.1.1205: completion: preinserted text not removed when closing ↵glepnir2025-03-15
| | | | | | | | | | pum (#32903) Problem: completion: preinserted text not removed when closing pum Solution: delete preinsert text inside in ins_compl_stop() (glepnir). closes: vim/vim#16891 https://github.com/vim/vim/commit/84a7503e29dc248661efc98b6c59d2e911452d5c
* vim-patch:9.1.1204: MS-Windows: crash when passing long string to expand() ↵zeertzjq2025-03-15
| | | | | | | | | | | | (#32902) Problem: MS-Windows: crash when passing long string to expand() with 'wildignorecase'. Solution: Use the same buflen as unix_expandpath() in dos_expandpath(). Remove an unnecessary STRLEN() while at it (zeertzjq). closes: vim/vim#16896 https://github.com/vim/vim/commit/00a749bd90e6b84e7e5132691d73fe9aa3fdff05
* vim-patch:9.0.1458: buffer overflow when expanding long file namezeertzjq2025-03-15
| | | | | | | | | | Problem: Buffer overflow when expanding long file name. Solution: Use a larger buffer and avoid overflowing it. (Yee Cheng Chin, closes vim/vim#12201) https://github.com/vim/vim/commit/a77670726e3706973adffc2b118f4576e1f58ea0 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:8.2.4963: expanding path with "/**" may overrun end of bufferzeertzjq2025-03-15
| | | | | | | | | Problem: Expanding path with "/**" may overrun end of buffer. Solution: Use vim_snprintf(). https://github.com/vim/vim/commit/386c24cd262edac66a31add2fd989c96c4c2c952 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor(gen_keycodes): put TAB and K_TAB together (#32882)zeertzjq2025-03-14
| | | | Keep track of the original indexes of both TAB and K_TAB, so that there doesn't have to be an extra table and loop for K_TAB.
* fix(messages): no trailing newline for inputlist, tselect, z= with ext_messagesLuuk van Baal2025-03-13
| | | | | | | | | | Problem: Various list commands end in a newline to go to a new line on the message grid for the prompt message, which is unwanted with ext_messages. Solution: Don't emit a trailing newline with ext_messages for inputlist(), :tselect and z=. Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
* vim-patch:9.1.1195: inside try-block: fn body executed with default arg ↵zeertzjq2025-03-13
| | | | | | | | | | | | | | | undefined (#32866) Problem: inside try-block: fn body executed when default arg is undefined Solution: When inside a try-block do not execute function body after an error in evaluating a default argument expression (Shane Harper). closes: vim/vim#16865 https://github.com/vim/vim/commit/2d18789aa67cc60072ea0cf21811c403fa0b2c7b Co-authored-by: Shane Harper <shane@shaneharper.net>
* vim-patch:c1c3b5d: runtime(doc): remove unnecessary "an" (#32865)zeertzjq2025-03-13
| | | | | | | | | | | | "umask" is pronounce like "youmask", so having an "an" before it is a bit strange. In other places in the help, "umask" is not preceded by either "a" or "an", and sometimes preceded by "the". Also, "Note" is usually followed either by ":" or "that" in builtin.txt, so add a ":" after "Note". closes: 16860 https://github.com/vim/vim/commit/c1c3b5d6a0a3032057bf6de8672cc79100bb73c9
* fix(terminal): delay when finishing terminal process #32846markstegeman2025-03-12
| | | | | | | | | | Problem: On Windows, the first attempt at finishing up after a terminal process terminates is delayed by 200ms, even if it would be possible to finish up immediately. Solution: Make the first attempt at finishing up immediately after the process terminates.
* refactor(popup): use plines_m_win #32857glepnir2025-03-12
| | | | | Problem: Custom inline function duplicated existing functionality Solution: Used existing plines_m_win function to reduce code duplication
* vim-patch:0a336cc: runtime(doc): clarify that a umask is applied to mkdir() ↵zeertzjq2025-03-11
| | | | | | | | | (#32845) fixes: vim/vim#16849 https://github.com/vim/vim/commit/0a336ccb57003c44ba303ccc50cf50cb640c2309 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(ui): schedule UI detach (#32827)Gregory Anders2025-03-11
| | | | | | | | | | When a UI detaches it will execute any UILeave events. Autocommands cannot run in a libuv handler because they will in turn poll the event loop, which results in recursive loop execution. So we schedule the callback to detach the UI on the main event queue. We also have to schedule the exit when the RPC channel is closed to ensure it does not run until after `remote_ui_disconnect` has run, otherwise it will hang.
* feat(treesitter): allow disabling captures and patterns on TSQuery (#32790)Ian Chamberlain2025-03-11
| | | | | | | | | Problem: Cannot disable individual captures and patterns in treesitter queries. Solution: * Expose the corresponding tree-sitter API functions for `TSQuery` object. * Add documentation for `TSQuery`. * Return the pattern ID from `get_captures_at_pos()` (and hence `:Inspect!`).
* vim-patch:9.1.1193: Unnecessary use of STRCAT() in au_event_disable() (#32829)zeertzjq2025-03-11
| | | | | | | | | | | | | Problem: Unnecessary use of STRCAT() in au_event_disable(). STRCAT() seeks to the end of new_ei, but here the end is already known. Solution: Use STRCPY() and add p_ei_len to new_ei. Also fix a typo in a comment. Add a test that 'eventignore' works in :argdo (zeertzjq). closes: vim/vim#16844 https://github.com/vim/vim/commit/969e11a18b145241dc0ab39fc1be7ed814655dfc Cherry-pick p_ei_len from patch 9.1.0256.
* fix(events): fix incorrect capitalization of Cmdwin* events (#32813)zeertzjq2025-03-11
| | | | | | The name of Cmdwin* events were changed to CmdWin* in 8ed2dbf6e2802516501c11e72e5d6d977e6a07f3 without explanation. This commit changes them back. This doesn't affect the creation or execution of autocommands. It only affects the listing of autocommands.
* docs(vvars): vim.v.event.windows #32673Vlad2025-03-10
|
* fix(popup): new preview_bufnr created when menu item is selected #32819glepnir2025-03-10
| | | | | | | | Problem: "use_float" in the if-condition causes a new buffer to be generated on every execution. Solution: - Remove the incorrect use_float check from the condition. - Use buf_clear to properly clear the existing buffer.
* fix(lua): types for vim.api.keyset.win_config #32700Tomasz N2025-03-10
|
* refactor(gen_events): sort enums case-insensitively (#32811)zeertzjq2025-03-10
| | | | | | | | This actually only affects the order in which Cmdline* and Cmdwin* autocommands are listed, and it appears that the names of Cmdwin* were changed to CmdWin* in 8ed2dbf6e2802516501c11e72e5d6d977e6a07f3 without explanation. Also, remove the final NULL element from the names table.
* vim-patch:9.1.1190: C indentation does not detect multibyte labels (#32808)zeertzjq2025-03-09
| | | | | | | | | | | Problem: C indentation does not detect multibyte labels Solution: Correctly skip over multibyte characters (Anttoni Erkkilä) closes: vim/vim#16770 https://github.com/vim/vim/commit/f4d87ff8883e5076633ef0ab0cf4d6e4beaddc5c Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
* perf(events): use hashy for event name lookup (#32802)zeertzjq2025-03-10
|
* docs(api): show "since" in API docs #32806Justin M. Keyes2025-03-09
|
* Merge #32687 "g<" for ext_messagesJustin M. Keyes2025-03-09
|\
| * feat(messages): "g<" mapping for ext_messagesLuuk van Baal2025-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot use "g<" mapping with ext_messages. Mapping displays the scrollback buffer since the last command, but the scrollback buffer is not populated with ext_messages. Solution: With ext_messages; store messages in the history that otherwise wouldn't be. Mark them as temporary messages to be deleted when the scrollback buffer would be cleared. To this end, make the message history a doubly-linked list such that messages can be removed from an arbitrary position. Outlook: Default ext_messages UI might not show the hit-enter prompt so we want "g<" to work as a recommended way to show messages for the last command (prompted by an indicator).
| * refactor(messages): simplify message historyLuuk van Baal2025-03-03
| |
* | fix(nvim__set_complete): pum preview info truncated during completion #32555glepnir2025-03-09
| | | | | | | | | | | | | | | | | | | | | | Problem: 1. The original info text is truncated in pum_set_preview_text. 2. There is an extra newline character at the end of the info text. 3. Incorrect usage of plines_win leads to errors in calculating the window height. Solution: 1. Improved string handling in pum_preview_set_text to safely process line content without modifying the original text. Now, the preview info is correctly preserved while splitting lines. 2. Do not append a trailing newline to the preview buffer when one is present at the end. 3. Set w_widher_inner in advance; otherwise, plines_win cannot correctly calculate the wrapped line height.
* | fix(build): vimdoc tags are not validated #32801Justin M. Keyes2025-03-09
| | | | | | | | | | | | | | | | | | Problem: "make lintdoc" is not validating vimdoc (:help) tags. Solution: - Call `lang_tree:parse()` to init the parser. - Load netrw 🤢 explicitly, since it was moved to `pack/dist/opt/`. - Fix invalid help tags.
* | build(generator): add dependencies on hashy (#32796)zeertzjq2025-03-09
| | | | | | | | | | | | | | This allows generated sources to be automatically rebuilt when modifying hashy code. Also, appending to NVIM_GENERATED_FOR_{HEADERS,SOURCES} in the middle of custom commands is a bit strange. Move that after the custom commands.
* | refactor(hashy): use case labels instead of TOLOWER_ASC() (#32795)zeertzjq2025-03-09
| | | | | | | | | | | | | | | | | | Follow-up to #32768 This is slightly faster according to the benchmark. This also makes it a build error if hashy is used incorrectly (generating a case-insensitive hash function from mixed-case strings), as duplicate case labels aren't allowed.
* | vim-patch:9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc() ↵zeertzjq2025-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#32792) Problem: Unnecessary use of vim_tolower() in vim_strnicmp_asc(). Solution: Use TOLOWER_ASC() instead (zeertzjq). It was passing *s1 and *s2 to vim_tolower(). When char is signed, which is the case on most platforms, c < 0x80 is always true, so it already behaves the same as TOLOWER_ASC(). closes: vim/vim#16826 https://github.com/vim/vim/commit/b7dc5d3b6169efc8aa0b9d86476072877e74bc2c Use this function for hashy case-insensitive lookup, as it's ASCII-only. Note that this function doesn't cast TOLOWER_ASC() argument to uint8_t, so it'll treat a UTF-8 byte as smaller than NUL. It doesn't matter, as one of the strings being compared is ASCII-only, and its behavior still leads to consistent ordering.
* | refactor(generator): remove nested loop for event aliases (#32780)zeertzjq2025-03-09
| | | | | | | | After #32777 the aliases no longer need to come later, so the list of autocommand names can be fully sorted.
* | refactor(multiqueue): rename multiqueue_new_parent #32767Justin M. Keyes2025-03-08
| |
* | docs: OSC 133 shell config #32771Justin M. Keyes2025-03-07
| |
* | fix(types): do not mark unstable API as privateLewis Russell2025-03-08
| | | | | | | | | | These functions are allowed to be used downstream, they are just not API stable.
* | perf(events): remove unnecessary loop in event_nr2name() (#32777)zeertzjq2025-03-08
| | | | | | | | | | | | | | It's no longer needed after #32152. I'll not apply this change to Vim first, because Nvim's event name aliases are a bit different from Vim. After this change there is a small speedup in nvim_exec_autocmds as per test/benchmark/autocmd_spec.lua.
* | fix(events): always allow some events to be nested (#32706)zeertzjq2025-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always allow the following four events to be nested, as they may contain important information, and are triggered on the event loop, which may be processed by a blocking call inside another autocommand. - ChanInfo - ChanOpen - TermRequest - TermResponse There are some other events that are triggered on the event loop, but they are mostly triggered by user actions in a UI client, and therefore not very likely to happen during another autocommand, so leave them unchanged for now.
* | perf(keycodes): use hashy for string lookupzeertzjq2025-03-08
| | | | | | | | | | This is slightly faster than the binary search as per the benchmark, and allows handling the vim/vim#16821 situation in generator code.
* | vim-patch:partial:9.1.1179: too many strlen() calls in misc2.czeertzjq2025-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: too many strlen() calls in misc2.c Solution: refactor misc2.c and use bsearch() instead of a linear search to find matches in the key_names_table array (John Marriott). This commit changes misc2.c to use bsearch() to perform string searches of the key_names_table array. Implementation detail: - Some entries in this array have alternate names. Add field alt_name to point to the alternate name. - Some entries in this array are only available if a given feature is defined. Keep them in the array, but add a boolean field enabled to indicate if the record can be used or not. If the feature is not available, the corresponding enabled field is set to FALSE. In my measurements running the test suite on a huge non-gui build on linux, the number of string comparisons in get_special_key_code(): Before (linear search): 2,214,957 After (binary search): 297,770 A side effect of this is 1477 calls to STRLEN() in get_special_key_name() for the same test run are no longer necessary. closes: vim/vim#16788 https://github.com/vim/vim/commit/4a1e6dacbb2cc833353983bea7eac38191c9d3b4 Skip the mouse shape changes. Co-authored-by: John Marriott <basilisk@internode.on.net>
* | refactor(keycodes): generate key_names_table[] using Luazeertzjq2025-03-08
| | | | | | | | This allows easier refactoring.
* | fix(terminal): avoid rescheduling events onto the same queue (#32755)Gregory Anders2025-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When a function like vim.wait() is used, we continuously drain the main event queue until it is empty, never stopping for user input. This means the libuv timer never runs and the terminal never gets refreshed, so emit_termrequest continously reschedules itself onto the same event queue, causing an infinite loop. Solution: Use a separate "pending" event queue, where events that require a terminal refresh are temporarily placed. Drain this queue after a terminal refresh and events are copied back onto the main queue. This prevents infinite loops since the main event queue will always be able to properly drain.
* | fix(marks): mark winline as invalid if change is in a concealed line (#32766)luukvbaal2025-03-07
| | | | | | | | Code that checks whether a `w_lines` entry has become invalid due to a change in a folded line should now also check for concealed lines.
* | fix(lua): always use vim.inspect() for :lua= (#32715)zeertzjq2025-03-07
| |
* | fix(marks): wrong winline info for concealed line with below virt line (#32747)luukvbaal2025-03-06
| | | | | | | | | | | | | | Problem: Skipping over a concealed line for which `win_line()` _should_ be called because it has `virt_lines_above = false` lines associated with it. Solution: Don't include such a line in `wl_lastlnum` from the line above.
* | fix(terminal): improve cursor refresh handling (#32596)Sean Dewar2025-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: terminal mode cursor refresh logic has too many edge cases where it fails when events change curbuf. Solution: change the logic. Introduce cursor_visible to TerminalState to more reliably track if terminal mode has changed busy. Move visibility handling to refresh_cursor and move its call in refresh_terminal to terminal_check to avoid temporarily changed curbufs from influencing cursor state. This has the effect of "debouncing" shape/visibility updates to once per terminal state tick (with the final attributes taking effect, as expected). I think this is OK, but as a result it may also be warranted to update when redrawing during the same state tick (e.g: from events executing :redraw); this can be added later, if wanted. Also move previous tests to a more appropriate place.