summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/mark.c
AgeCommit message (Collapse)AuthorFiles
2026-04-20vim-patch:partial:9.2.0368: too many strlen() calls when adding strings to ↵zeertzjq1
dicts (#39237) Problem: too many strlen() calls when adding strings to dicts Solution: Refactor code to use string_T, use dict_add_string_len() instead of dict_add_string() (John Marriott) Additionally: - In textprop.c, in function prop_fill_dict() use a string_T to store local variable text_align. - In popupwin.c, use a string_T to store struct member pp_name in struct poppos_entry_T. - In mark.c, refactor function add_mark() to pass in the length of argument mname. - In insexpand.c: ->Use a string_T to store the elements of static array ctrl_x_mode_names. ->Refactor function trigger_complete_done_event(): ->->change type of argument char_u *word to string_T *word. ->->make one access of array ctrl_x_mode_names instead of two. ->Refactor function ins_compl_mode() to accept a string_T to return the resulting string. - In fileio.c: ->Refactor function getftypewfd() to accept a string_T to return the resulting string. ->In function create_readdirex_item() use a string_T to store local variable q. - In cmdexpand.c, store global cmdline_orig as a string_T. - In autocmd.c, in function f_autocmd_get() use a string_T to store local variables event_name and group_name. Measure their lengths once when they are assigned so they are not remeasured on each call to dict_add_string() in the subsequent for loop. - In channel.c, in function channel_part_info() drop local variable status and use s instead. Make s a string_T. closes: vim/vim#19999 https://github.com/vim/vim/commit/c13232699db413e735f30b5649c78a7f38a9a069 Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-04-19feat(events): trigger MarkSet autocmd in :delmarks #39156Ashley Hauck1
Problem: `api.nvim_buf_del_mark` already emits a `MarkSet` event with `col` and `line` set to 0. However, `:delmarks` currently emits no events. Solution: Change `:delmarks` to emit the same `col==line==0` event.
2026-04-14build: update clang v21, fix warningsdundargoc1
- `src/nvim/ex_cmds_defs.h`: use "U" instead of "u" per `readability-uppercase-literal-suffix`
2026-03-17fix(marks): make jumpoptions=view work with 'smoothscroll' (#38339)zeertzjq1
Problem: 'jumpoptions' "view" doesn't remember skipcol and may lead to glitched display with 'smoothscroll'. Solution: Save skipcol in the mark view. Also make sure skipcol doesn't exceed line size.
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
2025-12-07feat(events): MarkSet event, aucmd_defer() #35793Nathan Smith1
Problem: - Can't subscribe to "mark" events. - Executing events is risky because they can't be deferred. Solution: - Introduce `MarkSet` event. - Introduce `aucmd_defer()`. Helped-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-11-15docs: getpos, getregion, lspJustin M. Keyes1
2025-10-29fix(terminal): keep last cursor if it's on the last rowzeertzjq1
2025-10-29vim-patch:9.1.1885: Wrong restored cursor pos when re-entering buffer after ↵zeertzjq1
changes Problem: Wrong restored cursor position when re-entering a buffer previously viewed in a window after making changes to the same buffer in another window. Solution: Adjust per-window "last cursor" positions on buffer changes. (zeertzjq) closes: vim/vim#18655 https://github.com/vim/vim/commit/b2e6b328dafe1cdfff10f1e811355e514da8071d
2025-10-27fix(api): inconsistent scrolling when deleting before topline (#36301)zeertzjq1
Problem: Inconsistent scrolling when deleting before topline with API. Solution: Only special-case inserting just before topline, not deleting.
2025-10-25fix(terminal): adjust marks when deleting scrollback lines (#36294)zeertzjq1
This also fixes inconsistent scrolling behavior on terminal output when cursor is in the middle of the buffer and the scrollback is full.
2025-09-08fix(prompt_buffer): plugins can't set `':` mark #35624Shadman1
Problem: Currently, prompt_buffer manages `:` mark by itself and exposes it read-only mark. However when it fails there can be no mitigation made by plugins. The `:` mark should act like a regular marks and be modifiable. Solution: Allow plugins to set `:` mark.
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-06refactor(build): don't use the preprocessor when generating headersbfredl1
Using the preprocessor before generating prototypes provides some "niceties" but the places that rely on these are pretty few. Vastly simplifying the BUILD SYSTEM is a better trade-off. Unbalancing { } blocks due to the preprocessor is cringe anyway (think of the tree-sitter trees!), write these in a different way. Add some workarounds for plattform specific features. INCLUDE_GENERATED_DECLARATIONS flag is now technically redundant, but will be cleaned up in a follow-up PR as it is a big mess.
2025-07-07fix(prompt): lnum update via nvim_buf_set_lines if buf != curbuf #34833Mathias Fußenegger1
Fixes the case from https://github.com/neovim/neovim/issues/34561#issuecomment-3031536581
2025-06-24vim-patch:9.1.1476: missing out-of-memory checks in cmdexpand.c (#34624)zeertzjq1
Problem: missing out-of-memory checks in cmdexpand.c Solution: add missing out-of-memory checks, re-order code (John Marriott) This commit does the following: - in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT() - in expand_cmdline() move check for out-of-memory to cover both assignments of file_str - in nextwild() don't free `p2` until after it's last use. closes: vim/vim#17592 https://github.com/vim/vim/commit/1be5b375c4446976eb5a0a90d2cfa1d2d289a6ed N/A patch: vim-patch:9.1.1474: missing out-of-memory check in mark.c Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-06-19vim-patch:9.1.1467: too many strlen() calls (#34572)zeertzjq1
Problem: too many strlen() calls Solution: Change expand_env() to return string length (John Marriott) This commit does the following changes: - In expand_env_esc(): - return the length of the returned dst string. - refactor to remove some calls to STRLEN() and STRCAT() - add check for out-of-memory condition. - Change call sites in various source files to use the return value closes: vim/vim#17561 https://github.com/vim/vim/commit/fff0132399082b7d012d0c1291cf0c6c99e200ff Co-authored-by: John Marriott <basilisk@internode.on.net>
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-16vim-patch:9.1.1463: Integer overflow in getmarklist() after linewise ↵zeertzjq1
operation (#34532) Problem: Integer overflow in getmarklist() after linewise operation. Solution: Don't add 1 to MAXCOL (zeertzjq) related: neovim/neovim#34524 closes: vim/vim#17552 https://github.com/vim/vim/commit/93318a9933893103442f552b26bd0a41b98cb68b
2025-05-06fix(messages): "list_cmd" kind for mark commands #33874luukvbaal1
Problem: `:marks/jumps/changes` are missing a message kind. Solution: Assign the "list_cmd" kind to them.
2024-12-23refactor: iwyu #31637Justin M. Keyes1
Result of `make iwyu` (after some "fixups").
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-13refactor(highlight): make enum of builtin highlights start with 1bfredl1
This makes it possible to use HLF_ values directly as highlight id:s and avoids +1 adjustments especially around messages.
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.
2024-08-05refactor(shada): rework msgpack decoding without msgpack-cbfredl1
This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
2024-07-10vim-patch:9.1.0554: :bw leaves jumplist and tagstack data around (#29639)zeertzjq1
Problem: :bw leaves jumplist and tagstack data around (Paul "Joey" Clark) Solution: Wipe jumplist and tagstack references to the wiped buffer (LemonBoy) As documented the :bwipeout command brutally deletes all the references to the buffer, so let's make it delete all the entries in the jump list and tag stack referring to the wiped-out buffer. fixes: vim/vim#8201 closes: vim/vim#15185 https://github.com/vim/vim/commit/4ff3a9b1e3ba45f9dbd0ea8c721f27d9315c4d93 Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-06-01refactor: move shared messages to errors.h #26214Justin M. Keyes1
2024-03-14fix(api): fix set_lines viewport adjustment, but this time goodbfredl1
fixes #27720
2024-03-14vim-patch:9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()zeertzjq1
Problem: More code can use ml_get_buf_len() instead of STRLEN(). Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not set ml_line_textlen in ml_replace_len() if "has_props" is set, because "len_arg" also includes the size of text properties in that case. (zeertzjq) closes: vim/vim#14183 https://github.com/vim/vim/commit/94b7c3233ef534acc669b3083ed1fe59cf3a090b
2024-03-13fix(api/buffer): fix handling of viewport of non-current bufferbfredl1
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-12-30refactor: follow style guidedundargoc1
2023-12-20refactor: eliminate cyclic includesdundargoc1
2023-12-17refactor: move non-symbols to defs.h headersdundargoc1
2023-12-09refactor: format casting of negative number better (#26482)zeertzjq1
2023-11-29refactor: move some constants out of vim_defs.h (#26298)zeertzjq1
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq1
2023-11-20refactor: enable formatting for ternariesdundargoc1
This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
2023-11-19refactor: follow style guidedundargoc1
- reduce variable scope - prefer initialization over declaration and assignment
2023-11-19build: bump uncrustify versiondundargoc1
Biggest change is that uncrustify is silent during linting.
2023-11-17refactor(sign): move legacy signs to extmarksLuuk van Baal1
Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
2023-11-12build: remove PVSdundargoc1
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
2023-11-11refactor: remove redundant castsdundargoc1
2023-11-05refactor: the long goodbyedundargoc1
long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
2023-10-24fix(marks): handle switching buffer properly (#25763)zeertzjq1
2023-10-23build(lint): remove unnecessary clint.py rulesdundargoc1
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
2023-10-09refactor: the long goodbyedundargoc1
long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
2023-09-30refactor: reorganize option header files (#25437)zeertzjq1
- Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
2023-09-30build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq1