| Commit message (Collapse) | Author | Age |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes vim/vim#12104)
https://github.com/vim/vim/commit/960dcbd098c761dd623bec9492d5391ff6e8dceb
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| | |
Problem:
opt_idx possible negative value used as index
Solution:
check opt_idx not less than zero (kOptInvalid)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* refactor(options): generic expand and did_set callbacks
Problem:
Many options have similar callbacks to check the values are valid.
Solution:
Generalize these callbacks into a single function that reads the option
table.
* refactor: gen_options.lua
refactor: gen_options.lua - inline get_cond
* refactor(options): use a simpler format for the common default
|
| |
| |
| |
| |
| |
| | |
Problem: It was decided on Matrix chat that multitype options won't be necessary for Neovim options, and that options should only have a single canonical type. Therefore the code for supporting multitype options is unnecessary.
Solution: Remove the additional code that's used to provide multitype option support.
|
| |
| |
| |
| |
| | |
directly" (#31924)
Reverts #31112
|
| |\
| | |
| | | |
refactor(options): set option value for non-current context directly
|
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: Currently, we use `switch_option_context` to temporarily switch the current option context before setting an option for a different buffer / window. This is not ideal because we already support getting and setting option values for non-current contexts in the underlying implementation.
Solution: Set option value for non-current context by passing the context directly to the lower level functions. Also introduce a new `OptCtx` struct to store option context information, this will scale much better if we add more option scopes and other context information in the future.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: Although patch 9.1.0990 fixed a real problem/inconsistency,
it also introduced new behavior that may break BWC and/or be
unexpected. Before 9.1.0990, window commands could make the
topframe smaller (without changing 'cmdheight'; quirk that is
now fixed), but did not allow extending the topframe beyond
the 'cmdheight' set by the user. After 9.1.0990, the user can
reduce the 'cmdheight' below the value they set explicitly,
through window commands, which may lead to confusion.
(aftere v9.1.0990)
Solution: Store the value explicitly set by the user and clamp the
'cmdheight' when resizing the topframe. This also applies to
dragging laststatus, which in contrast to window commands
_did_ allow reducing the 'cmdheight' to values below the one
set by the user. So with this patch there is still new
behavior, but I think in a way that is less surprising.
While at it, also fix a Coverity warning, introduced in
v9.1.0990 (Luuk van Baal)
https://github.com/vim/vim/commit/c97e8695353565d6b20adffa48aad47f6e09967f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: Inconsistent behavior when changing cmdheight by resizing the
topframe through wincmds and dragging laststatus. Changing
cmdheight by resizing the topframe does not trigger OptionSet.
Solution: Consolidate logic for changing the cmdheight, set the option
value to handle side-effects (Luuk van Baal)
https://github.com/vim/vim/commit/e15cbc1af47e9dea90448c714eb4908e5d4302fc
vim-patch:9.0.0187: command line height changes when maximizing window height
Problem: Command line height changes when maximizing window height.
Solution: Do not change the command line height. (closes vim/vim#10885)
https://github.com/vim/vim/commit/96bde99bf890acd9952863a02c1d15edca2000e1
|
| |/ |
|
| |
| |
| | |
Result of `make iwyu` (after some "fixups").
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Two separate try/end wrappers, that only marginally differ by
restoring a few variables. Wrappers that don't restore
previous state are dangerous to use in "api-fast" functions.
Solution: Remove wrappers that don't restore the previous state.
Always use TRY_WRAP.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
tabpages (#31378)
Problem: the max value of 'cmdheight' is limited by other tabpages
Solution: Limit the maximum value of 'cmdheight' to the current tabpage only.
(Milly)
The Help says that cmdheight is local to the tab page, but says nothing
about the maximum value depending on the state of all tab pages. Users
may wonder why they can't increase cmdheight when there are still rows
available on the current tab page. This PR changes the behavior of
cmdheight so that its maximum value depends only on the state of the
current tab page.
Also, since magic numbers were embedded in various places with the
minimum value of cmdheight being 1, we defined a constant to make it
easier to understand.
closes: vim/vim#16131
https://github.com/vim/vim/commit/2cddf0e85a7f8304476397e1c51dcd0e41835ac3
Cherry-pick Test_cmdheight_not_changed() from patch 9.0.0187.
Co-authored-by: Milly <milly.ca@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: The name `scope` is often used to refer to option flags because
`OPT_LOCAL` and `OPT_GLOBAL` are often used to determine the option
scope. This leads to the name `req_scope` being used for actual option
scopes instead.
Solution: Since the end-goal is to remove `OPT_LOCAL` and `OPT_GLOBAL`
entirely and replace them with `OptScope`, rename `OptScope` variables
to `scope` and the old scope flag variables to `opt_flags`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
(Shougo Matsushita)
closes: vim/vim#16078
https://github.com/vim/vim/commit/9f860a14c308f7a9a27a6850d36790615717a710
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
|
| |
| |
| | |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| | |
Add kinds for various commands that output a list, the 'wildmode'
list, and for number prompts.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
value to 500 (Shougo Matsushita)
closes: vim/vim#16048
https://github.com/vim/vim/commit/4bd9b2b2467e696061104a029000e9824c6c609e
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
|
| |
| |
| |
| |
| | |
This makes it possible to use HLF_ values directly as highlight id:s
and avoids +1 adjustments especially around messages.
|
| |\
| | |
| | | |
feat(ext_messages): add hl_id to ext_messages chunks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Co-authored-by: Ernie Rael <errael@raelity.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| | |
| | |
| | | |
Conversely, don't use them for global options.
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Problem:
The `varp` argument for `set_option` is extraneous as the option's
variable pointer can be retrieved using the option's index and flags.
Solution:
Remove the `varp` argument for `set_option`
|
| |\
| | |
| | | |
refactor(options): remove fileformat macros
|
| | | |
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
There are three different ways of marking an option as hidden, `enable_if
= false`, `hidden = true` and `immutable = true`. These also have different
behaviors. Options hidden with `enable_if = false` can't have their value
fetched using Vim script or the API, but options hidden with `hidden = true` or
`immutable = true` can. On the other hand, options with `hidden = true` do not
error when trying to set their value, but options with `immutable = true` do.
Solution:
Remove `enable_if = false`, remove the `hidden` property for options, and use
`immutable = true` to mark an option as hidden instead. Also make hidden option
variable pointers always point to the default value, which allows fetching the
value of every hidden option using Vim script and the API. This does also mean
that trying to set a hidden option will now give an error instead of just being
ignored.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
Problem: `get_option_value_for` can perfectly replace `get_option_value_strict`, making the latter redundant.
Solution: Remove `get_option_value_strict`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
There are three separate functions for printing the `:set` command for
an setting an option to a file descriptor. These functions are used when
creating the session file for an option. Having a function for each type
increase code duplication and also makes it harder to add logic for new
option types.
Solution:
Replace `put_set(num|bool|string)` with a single `put_set` function
which works for all option types, this reduces code duplication and also
makes it trivial to add support for more option types in the future.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
Instead of keeping `P_ALLOCED` and `P_DEF_ALLOCED` flags to check if an
option value is allocated, always allocate option values to simplify the
logic.
Ref: #25672
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: We use `void *` for option default values, which is confusing and can cause problems with type-correctness. It also doesn't accomodate for multitype options. On top of that, it also leads to default boolean option values not behaving correctly on big endian systems.
Solution: Use `OptVal` for option default values.
BREAKING CHANGE:
- `:set {option}<` removes the local value for all global-local options instead of just string global-local options.
- `:setlocal {option}<` copies the global value to the local value for number and boolean global-local options instead of removing the local value.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: tests: no error check when setting global 'briopt'
Solution: also parse and check global 'briopt' value (Milly)
closes: vim/vim#15911
https://github.com/vim/vim/commit/b38700ac81d90a652e5c8495056dd78df5babdde
Co-authored-by: Milly <milly.ca@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: tests: no error check when setting global 'cc'
Solution: also parse and check global 'cc' value (Milly)
closes: vim/vim#15914
https://github.com/vim/vim/commit/a441a3eaabbfc14b4772e07ecbecaaff3bd06a58
Co-authored-by: Milly <milly.ca@gmail.com>
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: 'spell' option setting has problems
Solution: correctly check for comma for 'spellfile' option,
remove unnecessary checks, refactor slightly (Milly)
closes: vim/vim#15873
https://github.com/vim/vim/commit/322ad0c953b7a3023cd2a65db61d05e180a5d682
Co-authored-by: Milly <milly.ca@gmail.com>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
correctly (#30704)
Problem: 'cedit', 'termwinkey' and 'wildchar' may not be parsed
correctly
Solution: improve string_to_key() function in option.c
(Milly)
- Problem: `^@` raises an error.
Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
Solution: They are stored as a single character.
closes: vim/vim#15811
https://github.com/vim/vim/commit/a9c6f90918d0012d1b8c8c5c1dccb77407f553fb
Co-authored-by: Milly <milly.ca@gmail.com>
|