aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
Commit message (Collapse)AuthorAge
...
| * vim-patch:9.1.0759: screenpos() may return invalid position (#30681)zeertzjq2024-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: screenpos() may return invalid position after switching buffers (Greg Hurrell) Solution: reset w_leftcol if wrapping has been set after copying wrap option fixes: vim/vim#15792 closes: vim/vim#15803 https://github.com/vim/vim/commit/b065a10e245d020c11b521a2a5062300ca9891fc Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:9.1.0758: it's possible to set an invalid key to 'wildcharm' (#30662)zeertzjq2024-10-05
| | | | | | | | | | | | | | | | | | | | | | Problem: it's possible to set an invalid key to 'wildcharm' Solution: error out, if the 'wildcharm' value is an invalid key (Milly) closes: vim/vim#15787 https://github.com/vim/vim/commit/40c6babc1789aceb241b23bab76eea16da37e33d Co-authored-by: Milly <milly.ca@gmail.com>
| * docs: misc (#30177)dundargoc2024-09-29
| | | | | | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * 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.0727: too many strlen() calls in option.c (#30338)zeertzjq2024-09-10
| | | | | | | | | | | | | | | | | | | | | | Problem: too many strlen() calls in option.c Solution: refactor the code to reduce the number of strlen() calls (John Marriott) closes: vim/vim#15604 https://github.com/vim/vim/commit/95dacbb5fd53f76a7e369c554aaa02e86b81eca8 Co-authored-by: John Marriott <basilisk@internode.on.net>
| * fix(scrollbind): properly take filler/virtual lines into accountLewis Russell2024-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `'scrollbind'` does not work properly if the window being scrolled automatically contains any filler/virtual lines (except for diff filler lines). This is because when the scrollbind check is done, the logic only considers changes to topline which are represented as line numbers. Solution: Write the logic for determine the scroll amount to take into account filler/virtual lines. Fixes #29751
| * revert: "refactor: use S_LEN macro" (#29319)Lewis Russell2024-06-14
| | | | | | | | | | revert: "refactor: use S_LEN(s) instead of s, n (#29219)" This reverts commit c37695a5d5f2e8914fff86f3581bed70b4c85d3c.
| * Merge pull request #29278 from bfredl/strcatbfredl2024-06-11
| |\ | | | | | | refactor(memory): use builtin strcat() instead of STRCAT()
| | * refactor(memory): use builtin strcat() instead of STRCAT()bfredl2024-06-11
| | | | | | | | | | | | | | | | | | | | | | | | The latter was mostly relevant with the past char_u madness. NOTE: STRCAT also functioned as a counterfeit "NOLINT" for clint apparently. But NOLINT-ing every usecase is just the same as disabling the check entirely.
| * | refactor: use S_LEN(s) instead of s, n (#29219)James2024-06-11
| |/
| * vim-patch:9.1.0472: Inconsistencies between functions for option flags (#29262)zeertzjq2024-06-10
| | | | | | | | | | | | | | | | | | Problem: Inconsistencies between functions for option flags. Solution: Consistently use "unsigned int" as return type and rename get_bkc_value() to get_bkc_flags() (zeertzjq). closes: vim/vim#14925 https://github.com/vim/vim/commit/aa925eeb97bd294d4a5253a3194949a37cbc8365
| * 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
| * refactor: move shared messages to errors.h #26214Justin M. Keyes2024-06-01
| |
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-05-24
|\|
| * 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
| * refactor(options): swap `immutable` and `hidden` option property namesFamiu Haque2024-03-27
| | | | | | | | Ref: https://github.com/neovim/neovim/pull/28018#issuecomment-2021622120
| * refactor(options): make `immutable` and `hidden` options distinctFamiu Haque2024-03-26
| | | | | | | | | | | | Problem: Currently, the `immutable` property of options can be applied for options that are hidden and options whose value simply can't be changed. Which is problematic when attempting to convert an option like `'maxcombine'` into an immutable option, because trying to `:set` an immutable option currently gives an error, which is only desired behavior for hidden options, not options that are actually immutable. Solution: Separate the `immutable` property into two distinct `hidden` and `immutable` properties. Change all options with the `immutable` property to use the `hidden` property instead. Also add `p_mco` as an `immutable` option, as its value cannot be changed, and the underlying variable is not used anywhere.
| * refactor(options): remove `set_string_option_direct()`Famiu Haque2024-03-21
| | | | | | | | | | | | Problem: `set_string_option_direct()` contains a separate codepath specifically for setting string options. Not only is that unnecessary code duplication, but it's also limited to only string options. Solution: Replace `set_string_option_direct()` with `set_option_direct()` which calls `set_option()` under the hood. This reduces code duplication and allows directly setting an option of any type.
| * refactor(options): add `direct` flag to `set_option()`Famiu Haque2024-03-21
| |
| * refactor(options): restructure `set_option`Famiu Haque2024-03-21
| |
| * fix(api/buffer): fix handling of viewport of non-current bufferbfredl2024-03-13
| | | | | | | | | | | | | | | | | | | | | | 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
| * feat(ui): allow non-zero 'cmdheight' with ext_messagesLuuk van Baal2024-03-11
| | | | | | | | | | | | | | Problem: Arbitrary restriction on 'cmdheight' with ext_messages. The 'cmdheight'-area may be desirable for the replacing cmdline. Solution: Allow non-zero 'cmdheight' with ext_messages.
| * 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
|\|
| * vim-patch:9.1.0114: Setting some options may change curswant (#27514)zeertzjq2024-02-18
| | | | | | | | | | | | | | | | | | Problem: Setting some options changes curswant unnecessarily. Solution: Add a P_HLONLY flag that prevents changing curswant. (zeertzjq) closes: vim/vim#14044 https://github.com/vim/vim/commit/fcaed6a70faf73bff3e5405ada556d726024f866
| * refactor: rename w_float_config to w_config #27419Will Hopkins2024-02-10
| | | | | | Follows up on rename of `FloatConfig` to `WinConfig` in #27397.
| * refactor(api): use arena for nvim_get_option_info()bfredl2024-02-09
| |
| * vim-patch:9.1.0074: did_set_breakat() should be in optionstr.czeertzjq2024-02-04
| | | | | | | | | | | | | | | | | | | | | | Problem: did_set_breakat() should be in optionstr.c as 'breakat' is a string option. Solution: Move did_set_breakat() to optionstr.c. (zeertzjq) closes: vim/vim#13958 https://github.com/vim/vim/commit/eac3fdcfa0b54281c37ffb66b4d4e8d1072cca1c
| * fix(options): use a union for def_val (#27169)zeertzjq2024-01-24
| | | | | | | | | | | | | | | | | | Problem: APIs get wrong boolean option default values on big-endian platforms. Solution: Use a union for def_val. Cannot use OptVal or OptValData yet as it needs to have the same types as option variables.
| * vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)zeertzjq2024-01-18
| | | | | | | | | | | | | | | | | | | | | | | | Problem: too vague errors for 'listchars'/'fillchars' Solution: Include the field name in error message. (zeertzjq) related: #27050 closes: vim/vim#13877 https://github.com/vim/vim/commit/6a8d2e1634f8f0d7463a2786dbcbe0f38dd287a7 Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
| * 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): remove `OPT_FREE` (#26963)Famiu Haque2024-01-10
| | | | | | | | | | | | Problem: `OPT_FREE` macro doesn't seem to do anything as `P_ALLOCED` already handles allocations. Solution: Remove `OPT_FREE`.
| * 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.
| * vim-patch:9.1.0010: Keymap completion is not available (#26888)zeertzjq2024-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Keymap completion is not available Solution: Add keymap completion (Doug Kearns) Add keymap completion to the 'keymap' option, user commands and builtin completion functions. closes: vim/vim#13692 https://github.com/vim/vim/commit/81642d9d6ff5cd6a90a012b1b98632ce51eeb1a8 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * refactor: remove redundant NOLINT commentsdundargoc2024-01-01
| |
| * refactor: follow style guidedundargoc2023-12-30
| |
| * Merge pull request #26642 from famiu/refactor/options/misczeertzjq2023-12-24
| |\ | | | | | | refactor(options): miscellanous refactors
| | * refactor(options): do bound checking in `validate_num_option()`Famiu Haque2023-12-24
| | |
| | * refactor(options): remove side effects from `check_num_option_bounds()`Famiu Haque2023-12-24
| | |
| | * refactor(options): move some functions from options.c to option.cFamiu Haque2023-12-23
| | |
| | * refactor(options): restructure functions related to key optionsFamiu Haque2023-12-23
| | |
| * | refactor: remove os_errmsg and os_msg functionsdundargoc2023-12-23
| |/ | | | | | | Instead replace them with fprintf and printf.
| * refactor(IWYU): add "private" pragma to more generated headers (#26706)zeertzjq2023-12-22
| | | | | | | | | | "export" only prevents IWYU from adding these headers if the headers that export them are included, while "private" ensures that IWYU never adds these headers.
| * refactor(IWYU): move decor provider types to decoration_defs.h (#26692)zeertzjq2023-12-21
| |
| * refactor: use `bool` to represent boolean valuesdundargoc2023-12-19
| |
| * fix(options): setting 'scroll' with resized grid (#26628)zeertzjq2023-12-18
| |
| * refactor: move non-symbols to defs.h headersdundargoc2023-12-17
| |
| * refactor(options): use hashy for finding options (#26573)Famiu Haque2023-12-17
| | | | | | | | | | | | | | | | | | | | | | Problem: `findoption()` searches through the options[] table linearly for option names, even though hashy can be used to generate a compile-time hash table for it. Solution: Use hashy to generate a compile time hash table for finding options. This also allows handling option aliases, so we don't need separate options[] table entries for things like 'viminfo'.
| * refactor(options): remove option type macrosFamiu Haque2023-12-14
| | | | | | | | | | | | | | | | Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future. Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future. Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
| * refactor(options): define `kOptIndexCount`Famiu Haque2023-12-10
| | | | | | | | Add a macro to indicate the option count so that we can iterate through the options[] table more clearly. This also removes the need for having an option with NULL fullname at the end of `options[]`.