aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahmJosh Rahm2025-02-05
|\
| * feat(api): nvim_open_win() relative to tabline and laststatus #32006luukvbaal2025-01-14
| | | | | | | | | | | | | | Problem: Anchoring a floating window to the tabline and laststatus is cumbersome; requiring autocommands and looping over all windows/tabpages. Solution: Add new "tabline" and "laststatus" options to the `relative` field of nvim_open_win() to place a window relative to.
| * refactor(wininfo): change wininfo from a linked list to an arraybfredl2024-12-16
| | | | | | | | | | | | | | | | | | | | "wininfo" is going to be my next victim. The main problem with wininfo is that it is "all or nothing", i e either all state about a buffer in a window is considered valid or none of it is. This needs to be fixed to address some long running grievances. For now this is just a warmup: refactor it from a linked list to a vector.
| * refactor(options): autogenerate valid values and flag enums for options (#31089)Famiu Haque2024-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * fix(highlight): 'winhl' shouldn't take priority over API (#31288)zeertzjq2024-11-22
| |
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-25
|\|
| * refactor(options): remove `.indir`, redesign option scopes #31066Famiu Haque2024-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The way option scopes currently work is inflexible and does not allow for nested option scopes or easily finding the value of an option at any arbitrary scope without having to do long handwritten switch-case statements like in `get_varp()`. `.indir` is also confusing and redundant since option indices for each scope can be autogenerated. Solution: Expand option scopes in such a way that an option can support any amount of scopes using a set of scope flags, similarly to how it's already done for option types. Also make options contain information about its index at each scope it supports. This allows for massively simplifying `get_varp()` and `get_varp_scope()` in the future by just using a struct for options at each scope. This would be done by creating a table that stores the offset of an option's variable at a scope by using the option's index at that scope as a key. This PR also autogenerates enums for option indices at each scope to remove the need for `.indir` entirely, and also to allow easily iterating over options all options that support any scope. Ref: #29314
| * 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.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(options): option flags enum #30961Famiu Haque2024-10-28
| | | | | | | | | | Problem: Currently we use macros with hardcoded flag values for option flags, which is messy and requires a lot of mental math for adding / removing option flags. Using macros for option flags also means that they cannot be used inside debuggers. Solution: Create a new `OptFlags` enum that stores all the option flags in an organized way that is easier to understand.
| * feat(float): allow enabling mouse for non-focusable window (#30844)zeertzjq2024-10-20
| | | | | | | | Problem: Cannot allow mouse interaction for non-focusable float window. Solution: Add a "mouse" field to float window config.
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-19
|\|
| * refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
| * vim-patch:9.1.0679: Rename from w_closing to w_locked is incompletezeertzjq2024-08-17
| | | | | | | | | | | | | | | | | | | | | | Problem: Rename from w_closing to w_locked is incomplete (after 9.1.0678). Solution: Rename remaining occurrences of w_closing to w_locked and update comments (zeertzjq). closes: vim/vim#15504 https://github.com/vim/vim/commit/bc11f6d9d4f580179d3963f3c489881904d6cd62
| * vim-patch:9.1.0678: [security]: use-after-free in alist_add()zeertzjq2024-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: use-after-free in alist_add() (SuyueGuo) Solution: Lock the current window, so that the reference to the argument list remains valid. This fixes CVE-2024-43374 https://github.com/vim/vim/commit/0a6e57b09bc8c76691b367a5babfb79b31b770e8 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * feat(diff): do not try external when out of memoryLewis Russell2024-08-15
| | | | | | | | - Also merge diff_buf_idx_tp into diff_buf_idx.
| * refactor(shada): rework msgpack decoding without msgpack-cbfredl2024-08-05
| | | | | | | | | | | | | | 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.
| * vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'zeertzjq2024-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot have buffer-local value for 'completeopt' (Nick Jensen). Solution: Make 'completeopt' global-local (zeertzjq). Also for some reason test Test_ColonEight_MultiByte seems to be failing sporadically now. Let's mark it as flaky. fixes: vim/vim#5487 closes: vim/vim#14922 https://github.com/vim/vim/commit/529b9ad62a0e843ee56ef609aef7e51b7dc8a4c8
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-05-24
|\|
| * vim-patch:9.1.0374: wrong botline in BufEnter (#28530)zeertzjq2024-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When :edit an existing buffer, line('w$') may return a wrong result. Solution: Reset w_valid in curwin_init() (Jaehwang Jung) `do_ecmd()` reinitializes the current window (`curwin_init()`) whose `w_valid` field may have `VALID_BOTLINE` set. Resetting `w_botline` without marking it as invalid makes subsequent `validate_botline()` calls a no-op, thus resulting in wrong `line('w$')` value. closes: vim/vim#14642 https://github.com/vim/vim/commit/eb80b8304efb6dfeaa8d01dd41fe281df4894240 Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
| * vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in ↵zeertzjq2024-04-01
| | | | | | | | | | | | | | | | | | | | | | | | other buf (#28136) Problem: Filetype may be undetected when a SwapExists autocommand sets filetype in another buffer. Solution: Make filetype detection state buffer-specific. Also fix a similar problem for 'modified' (zeertzjq). closes: vim/vim#14344 https://github.com/vim/vim/commit/5bf6c2117fcef85fcf046c098dd3eb72a0147859
| * vim-patch:9.1.0147: Cannot keep a buffer focused in a windowColin Kennedy2024-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: vim/vim#6445 closes: vim/vim#13903 https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea N/A patch: vim-patch:58f1e5c0893a
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2024-03-09
|\|
| * feat(extmark): window scoped extmarkaltermo2024-02-21
| | | | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * refactor: rename w_float_config to w_config #27419Will Hopkins2024-02-10
| | | | | | Follows up on rename of `FloatConfig` to `WinConfig` in #27397.
| * refactor: rename FloatConfig to WinConfig #27397Will Hopkins2024-02-09
| | | | | | | | | | `FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550
| * feat(api): make nvim_open_win support non-floating windows (#25550)Will Hopkins2024-02-01
| | | | | | | | Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows.
| * docs: enforce "treesitter" spelling #27110Jongwook Choi2024-01-28
| | | | | | It's the "tree-sitter" project, but "treesitter" in our code and docs.
| * perf(extmarks): add metadata for efficient filtering of special decorationsbfredl2024-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This expands on the global "don't pay for what you don't use" rules for these special extmark decorations: - inline virtual text, which needs to be processed in plines.c when we calculate the size of text on screen - virtual lines, which are needed when calculating "filler" lines - signs, with text and/or highlights, both of which needs to be processed for the entire line already at the beginning of a line. This adds a count to each node of the marktree, for how many special marks of each kind can be found in the subtree for this node. This makes it possible to quickly skip over these extra checks, when working in regions of the buffer not containing these kind of marks, instead of before where this could just be skipped if the entire _buffer_ didn't contain such marks.
| * fix(column): keep track of number of lines with number of signsLuuk van Baal2024-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some edge cases to the old (pre-#26406) and current "b_signcols" structure result in an incorrectly sized "auto" 'signcolumn'. Solution: * Implement a simpler 'signcolumn' validation strategy by immediately counting the number of signs in a range upon sign insertion and deletion. Decrease in performance here but there is a clear path forward to decreasing this performance hit by moving signs to a dedicated marktree, or by adding meta-data to the existing marktree which may be queried more efficiently? * Also replace "max_count" and keep track of the number of lines with a certain number of signs. This makes it so that it is no longer necessary to scan the entire buffer when the maximum number of signs decreases. This likely makes the commit a net increase in performance. * To ensure correctness we also have re-initialize the count for an edited region that spans multiple lines. Such an edit may move the signs within it. Thus we count and decrement before splicing the marktree and count and increment after.
| * refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | | | | | | | 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.
| * refactor(options): use schar_T representation for fillchars and listcharsbfredl2024-01-08
| | | | | | | | | | | | | | | | | | | | | | A bit big, but practically it was a lot simpler to change over all fillchars and all listchars at once, to not need to maintain two parallel implementations. This is mostly an internal refactor, but it also removes an arbitrary limitation: that 'fillchars' and 'listchars' values can only be single-codepoint characters. Now any character which fits into a single screen cell can be used.
| * refactor: remove redundant struct namesdundargoc2024-01-02
| | | | | | | | A struct can be anonymous if only its typedef is used.
| * refactor: follow style guidedundargoc2023-12-24
| |
| * refactor(options): generate BV_ and WV_ constants (#26705)zeertzjq2023-12-22
| |
| * refactor(IWYU): move decor provider types to decoration_defs.h (#26692)zeertzjq2023-12-21
| |
| * refactor: eliminate cyclic includesdundargoc2023-12-20
| |
| * feat(ui): completeopt support popup like vimmathew2023-12-16
| |
| * perf(column): keep track of number of lines that hold up the 'signcolumn'Luuk van Baal2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The entire marktree needs to be traversed each time a sign is removed from the sentinel line. Solution: Remove sentinel line and instead keep track of the number of lines that hold up the 'signcolumn' in "max_count". Adjust this number for added/removed signs, and set it to 0 when the maximum number of signs on a line changes. Only when "max_count" is decremented to 0 due to sign removal do we need to check the entire buffer. Also replace "invalid_top" and "invalid_bot" with a map of invalid ranges, further reducing the number of lines to be checked. Also improve tree traversal when counting the number of signs. Instead of looping over the to be checked range and counting the overlap for each row, keep track of the overlap in an array and add this to the count.
| * refactor(IWYU): move marktree types to marktree_defs.h (#26402)zeertzjq2023-12-05
| |
| * refactor: move float_relative_str[] to nvim_win_get_config() (#26344)zeertzjq2023-12-01
| | | | | | It's only used in one place, as it's usually conveyed as non-string.
| * refactor: move extern variables out of _defs.h files (#26320)zeertzjq2023-11-30
| |
* | Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
|\|
| * perf(column): only invalidate lines affected by added signLuuk van Baal2023-11-29
| |
| * refactor: fix headers with IWYUdundargoc2023-11-28
| |
| * refactor: move hashtab types to hashtab_defs.h (#26262)zeertzjq2023-11-28
| |
| * build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
| |
| * build: enable IWYU on macdundargoc2023-11-27
| |
| * refactor: move garray_T to garray_defs.h (#26227)zeertzjq2023-11-26
| |
| * refactor(sign): store 'signcolumn' width range when it is setLuuk van Baal2023-11-21
| | | | | | | | | | Problem: Minimum and maximum signcolumn width is determined each redraw. Solution: Determine and store 'signcolumn' range when option is set.