aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
Commit message (Collapse)AuthorAge
...
| * refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | - 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
| * build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
| |
| * refactor: remove longdundargoc2023-09-29
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
| * refactor(messages): fold msg_attr into msgbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * refactor(messages): fold msg_outtrans_attr into msg_outtransbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * Merge pull request #25155 from glepnir/fix_winhlbfredl2023-09-20
| |\ | | | | | | fix(highlight): winhl receive wrong argument
| | * fix(highlight): winhl receive wrong argumentglepnir2023-09-19
| | |
| * | vim-patch:8.2.4173: cannot use an import in 'foldexpr' (#25215)zeertzjq2023-09-17
| |/ | | | | | | | | | | | | | | | | Problem: Cannot use an import in 'foldexpr'. Solution: Set the script context to where 'foldexpr' was set. (closes vim/vim#9584) Fix that the script context was not set for all buffers. https://github.com/vim/vim/commit/e70dd11ef41f69bd5e94f630194e6b3c4f3f2102 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * fix(options): correct condition for calling did_set_option() (#25026)zeertzjq2023-09-05
| |
| * refactor(option): add set_option()Lewis Russell2023-08-31
| |
| * refactor(option): pass varp to set_string_optionLewis Russell2023-08-31
| |
| * refactor(option): option clearingLewis Russell2023-08-31
| |
| * refactor(option): remove OPT_CLEARLewis Russell2023-08-31
| |
| * refactor(option): further align set_string_option with do_set_option_string (2)Lewis Russell2023-08-31
| |
| * refactor(option): further align set_string_option with do_set_option_stringLewis Russell2023-08-31
| |
| * refactor(option): remove redundant localLewis Russell2023-08-31
| |
| * refactor(option): change some int to boolLewis Russell2023-08-31
| |
| * refactor(option.c): call did_set_option for all typesLewis Russell2023-08-31
| | | | | | | | | | | | | | | | set_option_value() only called did_set_option() for string options, whereas do_set_option_value() called it for all types. This change makes set_option_value() call did_set_option() for all types and thus makes it more consistent with do_set_option_value().
| * refactor(optionstr.c): remove redundant argumentLewis Russell2023-08-31
| |
| * refactor(option.c): remove did_set_string_option aliasLewis Russell2023-08-31
| |
| * refactor(option.c): move validation logic to functionLewis Russell2023-08-31
| |
| * vim-patch:9.0.1798: The 'syntax' option has no completion. (#24908)zeertzjq2023-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The 'syntax' option has no completion. Solution: Add syntax option completion. closes: vim/vim#12900 https://github.com/vim/vim/commit/6dfdff3f273dcea29099d81e3eceb871ae089998 N/A patches: vim-patch:9.0.1795: Indentation issues Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * refactor(option.c): move paste_option_changed() into did_set_paste()zeertzjq2023-08-23
| |
| * vim-patch:9.0.1781: Problems when setting bin/paste optionzeertzjq2023-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Problems when setting bin/paste option Solution: When setting binary/paste, remember that this also affects depending options, so that :verbose set returns the right location. Mention if depending options for 'binary' or 'paste' have been reset indirectly. Add a test to verify it works. Also noticed as small bug, that the global option value for expandtab was not reset when paste option is set, so fix that while at it. closes: vim/vim#12837 closes: vim/vim#12879 https://github.com/vim/vim/commit/757593c07a4f4ac43eb6c6e52fc299abc9bc08bc Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:9.0.1710: scrolloff options work slightly differentzeertzjq2023-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: sidescrolloff and scrolloff options work slightly different than other global-local options Solution: Make it behave consistent for all global-local options It was noticed, that sidescrolloff and scrolloff options behave differently in comparison to other global-local window options like 'listchars' So make those two behave like other global-local options. Also add some extra documentation for a few special local-window options. Add a few tests to make sure all global-local window options behave similar closes: vim/vim#12956 closes: vim/vim#12643 https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * refactor: cast to int earlier when using 'so' and 'siso' (#24756)zeertzjq2023-08-17
| |
| * feat(options)!: remove compatible behaviours for vim 5.0 and earlierLewis Russell2023-07-17
| |
| * refactor: remove longdundargoc2023-07-03
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
| * vim-patch:9.0.1670: resetting local option to global value is inconsistent ↵zeertzjq2023-06-28
| | | | | | | | | | | | | | | | | | | | | | (#24185) Problem: Resetting local option to global value is inconsistent. Solution: Handle "<" specifically for 'scrolloff' and 'sidescrolloff'. (closes vim/vim#12594) https://github.com/vim/vim/commit/bf5f189e449d6517239b79804d7a422a46946838 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor(option): use `void *` for pointer to option valueFamiu Haque2023-06-20
| | | | | | | | | | | | Option related code uses `char *` for pointer to option value, which is not the best way of representing a type-agnostic pointer. Solution: Make pointers to option value use `void *` instead.
| * vim-patch:9.0.1631: passing wrong variable type to option gives multiple ↵zeertzjq2023-06-15
| | | | | | | | | | | | | | | | errors (#24026) Problem: Passing a wrong variable type to an option gives multiple errors. Solution: Bail out early on failure. (closes vim/vim#12504) https://github.com/vim/vim/commit/4c7cb372c17a84c8a35254d93eb37cb854cd39da
| * refactor(options): use slash separator for `option_get_valid_types()` (#23945)Famiu Haque2023-06-07
| | | | | | | | | | | | `option_get_valid_types()` currently uses a comma separator for multi-type options which does not fit well with the changed error message for invalid option value type. A slash seperator is much more suited for its current use-case.
| * refactor(api): adjust errors for setting options (#23942)zeertzjq2023-06-07
| |
| * refactor(options): remove `getoption_T` and introduce `OptVal` (#23850)Famiu Haque2023-06-07
| | | | | | | | | | | | | | | | Removes the `getoption_T` struct and also introduces the `OptVal` struct to unify the methods of getting/setting different option value types. This is the first of many PRs to reduce code duplication in the Vim option code as well as to make options easier to maintain. It also increases the flexibility and extensibility of options. Which opens the door for things like Array and Dictionary options.
| * refactor(api): remove `BOOL` macro #23936Famiu Haque2023-06-06
| | | | | | Remove redundant `BOOL` macro that does the same thing as `BOOLEAN_OBJ`.
| * fix(tui): don't set tty background if &bg was set before VimEnter (#23701)Null Chilly2023-05-26
| |
| * refactor(api): new helper macrosFamiu Haque2023-05-23
| | | | | | | | Adds new API helper macros `CSTR_AS_OBJ()`, `STATIC_CSTR_AS_OBJ()`, and `STATIC_CSTR_TO_OBJ()`, which cleans up a lot of the current code. These macros will also be used extensively in the upcoming option refactor PRs because then API Objects will be used to get/set options. This PR also modifies pre-existing code to use old API helper macros like `CSTR_TO_OBJ()` to make them cleaner.
| * refactor: use xstrl{cpy,cat} on IObuff (#23648)ii142023-05-16
| | | | | | | | | | Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff Co-authored-by: ii14 <ii14@users.noreply.github.com>
| * vim-patch:9.0.1520: completion for option name includes all bool options ↵zeertzjq2023-05-07
| | | | | | | | | | | | | | | | | | | | | | (#23518) Problem: Completion for option name includes all bool options. Solution: Do not recognize the "noinv" prefix. Prefix "no" or "inv" when appropriate. https://github.com/vim/vim/commit/048d9d25214049dfde04c468c14bd1708fb692b8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.0644: 'smoothscroll' is not copied to a new window on :splitLuuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | Problem: 'smoothscroll' is not copied to a new window on :split. Solution: Copy the option value. Add a test. https://github.com/vim/vim/commit/b1fd26d208aadc96d3e8b9215f761150f40a9f91 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.0640: cannot scroll by screen line if a line wrapsLuuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot scroll by screen line if a line wraps. Solution: Add the 'smoothscroll' option. Only works for CTRL-E and CTRL-Y so far. https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9 vim-patch:9.0.0641: missing part of the new option code Problem: Missing part of the new option code. Solution: Add missing WV_SMS. https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor(option.c): make did_set callbacks staticLewis Russell2023-04-28
| |
| * vim-patch:9.0.1369: still some "else if" constructs for setting optionsLewis Russell2023-04-28
| | | | | | | | | | | | | | | | Problem: Still some "else if" constructs for setting options. Solution: Add a few more functions for handling options. (Yegappan Lakshmanan, closes vim/vim#12090) https://github.com/vim/vim/commit/c6ff21e876af0e3ad59664dd0f69359c4b6e9f1d
| * vim-patch:9.0.1353: too many "else if" statements to handle option valuesLewis Russell2023-04-28
| | | | | | | | | | | | | | | | Problem: Too many "else if" statements to handle option values. Solution: Add more functions to handle option value changes. (Yegappan Lakshmanan, closes vim/vim#12058) https://github.com/vim/vim/commit/6d611de58c8e324491415da8e79c6bd3faa3e848
| * vim-patch:9.0.1330: handling new value of an option has a long "else if" chainLewis Russell2023-04-28
| | | | | | | | | | | | | | Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes vim/vim#12015) https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e
| * refactor: uncrustifydundargoc2023-04-26
| | | | | | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
| * fix(column): don't reset 'statuscolumn' width after it has been drawnluukvbaal2023-04-24
| | | | | | | | | | | | | | | | Problem: 'statuscolumn' width may be reset after it has been drawn when multiple windows contain the same buffer. This results in an offset for the drawn cursor position. Solution: Loop over all windows (twice) prior to drawing them to reset the 'statuscolumn' width and validate the sign column when necessary.
| * vim-patch:9.0.1311: Coverity warns for using a NULL pointerLewis Russell2023-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity warns for using a NULL pointer. Solution: Use "empty_option" instead of NULL. https://github.com/vim/vim/commit/339e114d70de3ec2b36edf37d7ba7a7cfdf9d1a6 N/A patches for version.c: vim-patch:9.0.1405: missing check for out-of-memory Problem: Missing check for out-of-memory. Solution: Check for alloc() returning NULL pointer. (closes vim/vim#12149) https://github.com/vim/vim/commit/14338024c131b71a337c2bb87cb5904f5a5782b8
| * vim-patch:9.0.1308: the code for setting options is too complicatedLewis Russell2023-04-22
| | | | | | | | | | | | | | | | Problem: The code for setting options is too complicated. Solution: Refactor the code for setting options. (Yegappan Lakshmanan, closes vim/vim#11989) https://github.com/vim/vim/commit/1a6476428f63e9fa0c2cbea296e475e60363af11
| * vim-patch:9.0.1293: the set_num_option() is too longLewis Russell2023-04-22
| | | | | | | | | | | | | | | | Problem: The set_num_option() is too long. Solution: Move code to separate functions. (Yegappan Lakshmanan, closes vim/vim#11954) https://github.com/vim/vim/commit/0caaf1e46511f7a92e036f05e6aa9d5992540117