Problem:
- nvim_subscribe, nvim_unsubscribe were deprecated in
aec4938a21 but this wasn't set in the
API metadata.
- The function annotations
```
FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY FUNC_API_DEPRECATED_SINCE(13)
```
cause this test to fail:
```
RUN T3 api metadata functions are compatible with old metadata or have new level: 3.00 ms ERR
test/functional/api/version_spec.lua:135: function vim_subscribe was removed but exists in level 0 which nvim should be compatible with
stack traceback:
test/functional/api/version_spec.lua:135: in function <test/functional/api/version_spec.lua:128>
```
Solution:
- Set the API metadata.
- Rearrange the annotations so that FUNC_API_DEPRECATED_SINCE is 2nd:
```
FUNC_API_SINCE(1) FUNC_API_DEPRECATED_SINCE(13) FUNC_API_REMOTE_ONLY
```
In particular, make the distinction and interaction between "noinsert"
and "noselect" clearer as it was very confusing before.
closes: vim/vim#16148768728b487
Co-authored-by: dundargoc <gocdundar@gmail.com>
Problem: default for 'backspace' can be set in C code
Solution: promote the default for 'backspace' from defaults.vim to the C
code (Luca Saccarola)
closes: vim/vim#16143959ef61430
N/A patches:
vim-patch:9.1.0895: default history value is too small
vim-patch:075aeea: runtime(doc): document changed default value for 'history'
Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
Problem: runtime(compiler): pytest compiler not included
Solution: include pytest compiler, update the compiler completion test
(Konfekt)
closes: vim/vim#161303c2596a9e9
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Problem: completion list wrong after v9.1.0891
Solution: update compl_mach_array after leader change
(glepnir)
compl_shown_match update not correct after refactoring in v9.1.0891
Unfortunately, this regressed what item is selected after leader change.
So generate compl_match_array before updating compl_shown_match range,
and split generate compl_match_array into range match_head
fixes: https://github.com/vim/vim/issues/16128
closes: https://github.com/vim/vim/pull/16129a49c077a88
Problem: building the completion list array is inefficient
Solution: refactor and improve ins_compl_build_pum() func
(glepnir)
current time complexity is O(n^2). I guess garray is not used here to save memory and avoid efficiency
is caused by heap memory allocation. A simple way is to add an extra pointer as a single linked list
to store the matching compl_T, and traverse this single linked list to generate compl_match_array.
The time complexity is O(n x m). The worst case is m=n, but we can still get a little improvement.
Because the if condition does not need to be run at one time. This should be a good solution for now.
Later we may be able to complete it in O(lgn) time. But this requires more reconstruction. So this is
the first step.
closes: #1612580b662009c
compact formatter is no longer distributed with eslint, so:
- switch to '--format stylish' in makeprg
- update 'errorformat' for the 'stylish' format output
fixes: vim/vim#16126closes: vim/vim#16137dd21c89626
Co-authored-by: Romain Lafourcade <romainlafourcade@gmail.com>
Problem:
gen_declarations.lua is complex and has duplicate logic with
c_grammar.lua
Solution:
Move all lpeg logic to c_grammar.lua and refactor gen_declarations.lua.
* refactor(shared): extract `vim._list_insert` and `vim._list_remove`
* feat(lsp): add `vim.lsp.foldexpr()`
* docs(lsp): add a todo for state management
* feat(lsp): add `vim.lsp.folding_range.foldclose()`
* feat(lsp): schedule `foldclose()` if the buffer is not up-to-date
* feat(lsp): add `vim.lsp.foldtext()`
* feat(lsp): support multiple folding range providers
* refactor(lsp): expose all folding related functions under `vim.lsp.*`
* perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
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#161312cddf0e85a
Cherry-pick Test_cmdheight_not_changed() from patch 9.0.0187.
Co-authored-by: Milly <milly.ca@gmail.com>
Problem: 'fileencodings' default value should depend on 'encoding'. (Gary
Johnson)
Solution: When 'encoding' is "utf-8" use a different default value for
'fileencodings'.
5ffefbb35a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No test for what the spotbug compiler parses
(after commit: 65311c6f472de67b368)
Solution: Test &makeprg for the SpotBugs compiler plugin
(Aliaksei Budavei)
closes: vim/vim#1609660ddb1a140
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
**Problem:** The `context` parameter for `references()` is just typed as
a table, which is unhelpful.
**Solution:** Properly type it as an `lsp.ReferenceContext`!
Problem: ins_compl_add() has too many args
Solution: refactor it and use an int array instead of 2 separate int
args (glepnir)
closes: vim/vim#160625c66e23c62
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: %! item not allowed for 'rulerformat'
(yatinlala)
Solution: also allow to use %! for rulerformat option
(Yegappan Lakshmanan)
fixes: vim/vim#16091closes: vim/vim#16118ac023e8baa
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: The warning message is the same in different functions.
It is not convenient to locate the specific function name
Solution: add function name in warning message
Enabling private DEC mode 2031 tells the terminal to notify Nvim
whenever the OS theme changes (i.e. light mode to dark mode or vice
versa) or the terminal emulator's palette changes. When we receive one
of these notifications we query the terminal color's background color
again to see if it has changed and update the value of 'background' if
it has.
We only do this though if the user has not explicitly set the value of
'bg' themselves. The help text is updated slightly to hint to users that
they probably shouldn't set this value: on modern terminal emulators
Nvim is able to completely determine this automatically.
Problem: Possible unnecessary redraw after adding/deleting lines.
Solution: Check b_mod_set before using b_mod_xlines to avoid using stale
b_mod_xlines value (zeertzjq).
closes: vim/vim#161249f25a3a237
Problem:
`vim.loader.disable` does not conform to `:help dev-name-common` and
`:help dev-patterns`.
Solution:
- Add `enable` parameter to `vim.loader.enable`
- Remove `vim.loader.disable`
- Note the change in `:help news-breaking-dev` (HEAD changes).
- This is not a breaking change (except to "HEAD") because
`vim.loader` is marked "experimental".
previous: 26765e8461
Problem:
The default unimpaired mappings display an empty line after the
command's output. This results (with default configuration) in the
`Press ENTER or type command to continue` prompt to be displayed, like
so:
```
(2 of 16): item2
Press ENTER or type command to continue
```
Solution:
The cause is that we're checking the second return value from
`pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was
successful. `nvim_cmd` returns an empty string on success, so this value
is an empty string in the successful path which we then display.
The fix is simple: check the first return value instead which is the
"status code" of the call.
Problem:
LSP spec uses the term "position encoding" where we say "offset encoding".
Solution:
- Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking).
- Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
Problem: Hit double grid_line_start() assert when redrawing from
ext_messages msg_ruler event.
Solution: Do not start() batched grid calls when win_redr_ruler() will not
puts() anything.
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:
The default invocation would install the non-ucrt gcc package, the build would
fail now that UCRT is not supported. #22534
Solution:
Mention mingw-w64-ucrt pacman package instead.