Continuing the work of #31400
That PR allowed the provider to be invoked multiple times per line.
We want only to do that when there actually is more data later on the
line. Additionally, we want to skip over lines which contain no new
highlight items. The TS query cursor already tells us what the next
position with more data is, so there is no need to reinvoke the range
callback before that.
NB: this removes the double buffering introduced in #32619 which
is funtamentally incompatible with this (nvim core is supposed to keep
track of long ranges by itself, without requiring a callback reinvoke
blitz). Need to adjust the priorities some other way to fix the same issue.
The ellipsis literal (`...`) can be used in multiple contexts:
- Placeholders: `class Foo: ...`
- Containers: `Tuple[int, ...]`
- Assignments: `x = ...`
This is a trickier pattern to match because we can't rely on keyword
boundaries, so we instead look for exactly three dots (`...`).
This does mean that we will match the `...` portion of `x...x`, which
isn't valid Python syntax, but I think that's an acceptable trade-off
that avoids making this pattern much more complex.
Reference:
- https://docs.python.org/3/library/constants.html#Ellipsiscloses: vim/vim#1810777cfc49060
Co-authored-by: Jon Parise <jon@indelible.org>
Problem: complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
(Girish Palya)
This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.
Try: `:set ac cot=preinsert`
See `:help 'cot'` for more details.
closes: vim/vim#18213fa6fd41a94
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: nvim_win_set_config may crash when attempting to move curwin to a
different tabpage if there is no other non-float available to switch to.
Solution: fix the crash. Fix ONE_WINDOW checks in winframe_find_altwin and
win_altframe to consider floating windows by instead using one_window. Allow
one_window to consider non-current tabpages. We can use one_window in
win_close_othertab now to also better reflect its use in win_close.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: cmdline-autocompletion breaks history navigation (ddad431)
Solution: Support history navigation in cmdline autocompletion (Girish
Palya)
Up/Down arrows support history navigation when using wildtrigger()
fixes: vim/vim#18207closes: vim/vim#18219708ab7f5fb
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem:
Currently, prompt_buffer manages `:` mark by itself and exposes it
read-only mark. However when it fails there can be no mitigation made
by plugins. The `:` mark should act like a regular marks and be
modifiable.
Solution:
Allow plugins to set `:` mark.
Problem:
These "foo.vim" syntax tags add 100+ useless tags to help. In
particular, "progress.vim" is the first match for "progress", which not
the result anyone is actually looking for, since Nvim 0.12 gained the
"progress-message" feature.
Solution:
Drop the "foo.vim" syntax tags. The "ft-foo" tags are more appropriately
named.
The flakiness happens because get() uses vim.schedule(), and a following
key may be processed before the scheduled event. Use poke_eventloop() to
ensure that the scheduled event is processed.
Problem: Matches may be listed twice with wildmode=longest,list when
"longest" doesn't change command line (after 9.1.1737).
Solution: Set did_wild_list when trying "list" after "longest"
(zeertzjq).
closes: vim/vim#18227a28a2eb9d9
Problem: Patch v9.1.1714 introduce a regression for wildmenu (zeertzjq)
Solution: Restore behavior of "longest" in 'wildmode' (Girish Palya)
- Fixed a regression caused by PR vim/vim#18125 selecting wrong item
- Fixed another regression where the first pasted text did not appear on
the command-line after starting Vim.
closes: vim/vim#182128fec92d631
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: completion: long line shown twice
(Maxim Kim)
Solution: Fix the issue, disable an incorrect test.
(Girish Palya)
fixes: vim/vim#18035closes: vim/vim#1808857379302aa
Omit removal of blank line in Test_noselect_expand_env_var() as it's
added again in patch 9.1.1682.
Cherry-pick two blank lines in Test_long_line_noselect() from patch
9.1.1682.
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: During commandline completiom, popup window placement can be
incorrect when 'noselect' is present in 'wildmode'
(Shane-XB-Qian)
Solution: Disable "showtail" feature when 'noselect' is present.
fixes: vim/vim#17969closes: vim/vim#180011e38198a41
Partial port excluding the showtail change and the test.
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Some environment variables which are useful when working inside
a bare repository can affect any Git operation.
Solution: Explicitly unset problematic environment variables.
Problem:
There is no straightforward way to pretty-print objects as JSON.
The existing `vim.inspect` outputs LON.
Solution:
Introduce an `indent` option for `vim.json.encode()` which enables
human-readable output with configurable indentation.
Adapts PR to upstream: openresty/lua-cjson#114
Problem: w_pos_changed flag was being set redundantly after win_config_float call
Solution: remove duplicate assignment since win_config_float already sets this flag internally
Problem:
Force resolve `spec.version` overrides the information about whether
a user supplied `version` or not. Knowing it might be useful in some use
cases (like comparing to previously set `spec` to detect if it has
changed).
Solution:
Do not resolve `spec.version`. This also improves speed when triggering
events and calling `get()`.
- Place default branch first when listing all branches.
- Use correct terminology in `get_hash` helper.
- Do not return `{ '' }` if there are no tags.
Problem:
There is no way to get more information about installed plugins, like
current revision or default branch (necessary if resolving default
`spec.version` manually). As computing Git data migth take some time,
also allow `get()` to limit output to only necessary set of plugins.
Solution:
- introduce arguments to `get(names, opts)`, which follows other
`vim.pack` functions. Plugin extra info is returned by default and
should be opt-out via `opts.info = false`.
- Examples:
- Get current revision: `get({ 'plug-name' })[1].rev`
- Get default branch: `get({ 'plug_name' })[1].branches[1]`
- `update()` and `del()` act on plugins in the same order their names
are supplied. This is less surprising.
- default `opts.info` to `true` since this simplifies logic for the
common user, while still leaving the door open for a faster `get()` if
needed.
vim-patch:8.1.1919: using window options when passing a buffer to popup_create()
vim-patch:8.1.1954: more functions can be used as a method
vim-patch:8.1.1982: more functions can be used as methods
vim-patch:8.1.1986: more functions can be used as methods
vim-patch:8.1.1987: more functions can be used as methods
vim-patch:8.1.1993: more functions can be used as methods
vim-patch:8.1.1996: more functions can be used as methods
vim-patch:8.1.2004: more functions can be used as methods
vim-patch:8.1.2295: if buffer of popup is in another window cursorline sign shows
vim-patch:8.2.0568: the man filetype plugin overwrites the unnamed register
vim-patch:8.2.1186: with SGR mouse codes balloon doesn't show up after click
vim-patch:8.2.3539: GTK3: with 'rightleft' set scrollbar may move unintentionally
vim-patch:8.2.3681: cannot drag popup window after click on a status line
vim-patch:8.2.4561: build failure with some combination of features
vim-patch:8.2.4984: dragging statusline fails for window with winbar
vim-patch:9.0.0136: after CTRL-Left-mouse click a mouse scroll also has CTRL
vim-patch:9.0.0696: it is unclear if the +rightleft and +arabic features are used
vim-patch:9.0.0931: MS-Windows: mouse column limited to 223
vim-patch:9.0.1896: "below" virtual text doesn't work with 'rightleft'
As noted in #34908, the arm unittests fail due to unrecognized types:
ERROR test/unit/testutil.lua @ 802: Expressions parser works with &opt
test/unit/testutil.lua:774: test/unit/testutil.lua:758: (string) '
test/unit/testutil.lua:288: declaration specifier expected near '__SVFloat32_t''
exit code: 256
After testing on Debian's arm64 porterbox, the unittests cleanly pass
when ignoring various types defined in
/usr/include/aarch64-linux-gnu/bits/math-vector.h
Problem: The wasmtime version compatible with tree-sitter 0.25.x fails
current Rust lint.
Solution: Disable wasmtime build.
Rationale:
1. As the only Rust dependency, these force us into a fast-moving update cycle (new warnings for everyone!);
2. wasmtime has a monthly release cycle, but we're locked into whatever tree-sitter supports, and there's no clear compatibility matrix (and I no longer care enough to spend the time and effort keeping this synced between tree-sitter and neovim);
3. we only test building with wasmtime but not actually using wasm parsers (this was actually broken for a while without being caught);
4. we're probably not going to go with wasmtime as our default wasm engine anyway.
Problem: The document of nvim_buf_get_extmark currently lacks the
following:
- "details" directory: nvim_buf_get_extmarks() allows an option details
to get a "details" directory in result, but it doesn't mention where
that "details" directory is, what fields does it have.
Solution: Add docs for "details" directory in nvim_buf_get_extmarks()
Problem: after #34287 nvim_win_set_config no longer errors when attempting to
split from a floating window only if "win" is 0.
Solution: fix the regression, reduce the scope of "parent" and similar checks to
only where it's currently used and add test coverage for the errors.
Problem: `nvim_win_set_config` calls `win_find_tabpage(parent)` with redundant calls
Solution: Cache `parent_tp` early and reuse before window operations.