| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
`SREQ_*` values are now actual typedef'd enums. `get_option_value_strict()` has also been refactored and split into two functions, `get_option_attrs()` for getting the option attributes, and `get_option_value_strict()` for getting the actual value. Moreover, it now returns an `OptVal`. Other miscellaneous refactors have also been made.
|
| |
|
|
|
|
|
|
| |
Problem: The style guide states that all switch statements that are not conditional on an enum must have a `default` case, but does not give any explicit guideline for switch statements that are conditional on enums. As a result, a `default` case is added in many enum switch statements, even when the switch statement is exhaustive. This is not ideal because it removes the ability to have compiler errors to easily detect unchanged switch statements when a new possible value for an enum is added.
Solution: Add explicit guidelines for switch statements that are conditional on an enum, clarifying that a `default` case is not necessary if the switch statement is exhaustive. Also refactor pre-existing code with unnecessary `default` cases.
|
| |
|
|
|
|
|
| |
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
|
| |
|
|
|
|
|
| |
Initially this is just for geting rid of boilerplate,
but eventually the types could get exposed as metadata
|
|
|
|
| |
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
|
|
|
| |
Fixes #24398
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
|
|
|
|
| |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
|\
| |
| | |
fix(highlight): use winhl=Foo:Bar even when Bar is empty
|
| |
| |
| |
| | |
fixes #22906
|
|/
|
|
| |
message.c functions now take const char * as a format. Error message
definitions can be made const.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
fix(api): use local LastSet structure in nvim_get_option_info
* nvim_get_option_info is deprecated.
It is always using the global LastSet information as reported in #15232.
* nvim_get_option_info2 is added.
The new function additionally accepts an 'opts' table {scope, buf, win}
allowing to specify the option scope and query local options from another
buffer or window.
|
|
|
|
| |
- Fix a bug in the cache
- Set some buffer options on the dummy buffer
|
| |
|
| |
|
|
|
|
|
| |
- Also adjust the expr-mapping behaviour so normal commands and text
changes are allowed in internal dummy buffers.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Validation messages are not consistently formatted.
- Parameter names sometimes are NOT quoted.
- Descriptive names (non-parameters) sometimes ARE quoted.
Solution:
Always quote the `name` value passed to a VALIDATE macro _unless_ the
value has whitespace.
|
|
|
|
|
|
| |
- VALIDATE() takes a format string
- deduplicate check_string_array
- VALIDATE_RANGE
- validate UI args
|
|
|
|
|
|
|
|
|
| |
Problem:
- API validation involves too much boilerplate.
- API validation errors are not consistently worded.
Solution:
Introduce some macros. Currently these are clumsy, but they at least
help with consistency and avoid some nesting.
|
|
|
|
|
|
| |
MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3
(production quality) and 4 (informational). Enabling level 3 warnings
mostly revealed conversion problems, similar to GCC/clang -Wconversion
flag.
|
|
|
|
|
|
|
| |
Problem: Some source files are too big.
Solution: Move buffer and window related functions to evalbuffer.c and
evalwindow.c. (Yegappan Lakshmanan, closes vim/vim#4898)
https://github.com/vim/vim/commit/261f346f8154c0ec7094a4a211c653c74e9f7c2e
|
|
|
|
|
|
|
|
|
|
| |
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.
Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
|
|
|
|
| |
Lua makes (or reuses) an internal copy of strings, so we can safely push
buf pointers onto the stack.
|
|
|
|
|
|
|
|
|
|
| |
Problem: Cannot assign a lambda to an option that takes a function.
Solution: Automatically convert the lambda to a string. (Yegappan
Lakshmanan, closes vim/vim#9286)
https://github.com/vim/vim/commit/6409553b6e3b4de4e1d72b8ee5445595214581ff
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
| |
Fix those naughty single quotes.
closes #20159
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
|
|
|
|
|
|
|
| |
Problem: Vim9: bool option type is number.
Solution: Have get_option_value() return a different value for bool and
number options. (closes vim/vim#7583)
https://github.com/vim/vim/commit/dd1f426bd617ac6a775f2e7795ff0b159e3fa315
|
| |
|
|\
| |
| | |
fix(api): nvim_set_option_value for global-local options
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
global-local window options need to be handled specially. When `win` is
given but `scope` is not, then we want to set the local version of the
option but not the global one, therefore we need to force
`scope='local'`.
Note this does not apply to window-local only options (e.g. 'number')
Example:
nvim_set_option_value('scrolloff', 10, {}) -- global-local window option; set global value
nvim_set_option_value('scrolloff', 20, {win=0}) -- global-local window option; set local value
nvim_set_option_value('number', true, {}) -- local window option
is now equivalent to:
nvim_set_option_value('scrolloff', 10, {})
nvim_set_option_value('scrolloff', 20, {win=0, scope='local'}) -- changed from before
nvim_set_option_value('number', true, {win=0}) -- unchanged from before
Only the global-local option with a `win` provided gets forced to local
scope.
|
|/ |
|
|
|
|
|
|
|
|
| |
The main motivation for this is for the buf and win cases which need to
set up and restore context, and it's what specifically makes the
semantics of options nuanced, and thus this should not be repeated more
than once.
- nvim_get/set_option_value now share argument validation.
|
|
|
|
| |
These mirror their counterparts in nvim_set_option_value.
|
|
|