Problem:
We can resolve the `CompletionItem.detail` field but don't advertise
this capability.
Solution:
Add `detail` to
`textDocument.completion.completionItem.resolveSupport.properties`.
Problem:
Followup to #39858. close_windows returned a holder window just so
do_buffer_ext could retry there, but the non-float branch was dead code
and close_windows was called twice.
Solution:
Check one_window directly in do_buffer_ext, drop the holder, make
close_windows void again.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: Processing of a very long message may take a long time; there
is no visual feedback of work being done, and no way to abort
processing.
Calculating text height for spill indicator inhibits
performance for very long message.
Solution: Whenever writing part of a message is taking longer than 100ms,
show the first part of the message, while checking for CTRL-C.
Calculate ('wrap'-ed) text height accurately until 'lines',
use line count beyond that.
Problem:
(Followup to 54f22a8f01c0feb27a531b52aedf5cdbd5e51b24.)
Deleting another buffer from a floatwin could move focus into the holder
window and fire BufEnter for the buffer being deleted.
Solution:
Use switch_win_noblock() instead of buf_jump_open_win() before
recursing into do_buffer_ext().
Problem:
Potential documentation drift in `tui.txt` if fields for
`$NVIM_TERMDEFS` change.
Solution:
Generate docs for `tui.txt`. Add `brief_xform` to `gen_vimdoc.lua` to
allow transforming briefs during generation.
Problem: home_replace() function can be improved
Solution: Refactor home_replace() to return the length of the string
(John Marriott).
In addition:
- in function set_b0_fname() move ulen into the block where it is used.
- In function findswapname() rework logic around displaying "swap file
already exists" dialogue so that literal message text is set once.
closes: vim/vim#20249a0931a90ee
Co-authored-by: John Marriott <basilisk@internode.on.net>
This has been manually tested with my personal mbsync configuration and
with the following test file:
$ cat test.mbsyncrc
Channel Foo
# None may not be combined with other operations
Sync None
Sync None New
# First form
Sync Pull
Sync Push
Sync New
Sync Old
Sync Upgrade
Sync ReNew
Sync Gone
Sync Delete
Sync Flags
Sync Invalid
# Second form
Sync PullNew
Sync PullOld
Sync PullUpgrade
Sync PullReNew
Sync PullGone
Sync PullDelete
Sync PullFlags
Sync PullFull
Sync PullAll
Sync PullInvalid
Sync PushNew
Sync PushOld
Sync PushUpgrade
Sync PushReNew
Sync PushGone
Sync PushDelete
Sync PushFlags
Sync PushFull
Sync PushAll
Sync PushInvalid
Sync NewInvalid
# Multiple operations
Sync New Upgrade Gone Flags
# Mix of the two styles (an example from the mbsync manpage)
Sync PullNew PullGone Push
# Syntaxically correct, though they will raise a warning in mbsync:
Sync PullNew Pull
Sync PullNew Gone Push
closes: vim/vim#2024385eb099bf2
Co-authored-by: Cyril Roelandt <tipecaml@gmail.com>
Problem: shellescape() called without {special} flag for :! ex command
Solution: Pass 1 as second argument to shellescape() in :! contexts
related: Commit: 3fb5e58fbc63d86a3e65f1a141b0d67af2 (patch 9.2.0479:
[security]: runtime(tar): command injection in tar plugin)
129486193c
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
`nvim_create_autocmd` is too verbose and its `callback` requires extra
"nesting".
Solution:
Introduce `nvim_on`. Start using it internally. Then we can get a feel
for how it should look before making it public.
Problem: If there are pending messages when starting to build the
runtime search path, a msg_show callback may invoke
runtime_search_path_validate() recursively.
Solution: Avoid msg_show callback by ensuring messages are flushed.
Problem:
A benefit of the old `:LspInfo` was that it showed info related to the
"current buffer" a bit more clearly.
Solution:
Highlight the "current buffer" in the LSP checkhealth report.
Problem:
filewatcher and position-encoding info is reported after the big list of
client details.
Solution:
- report the info in the top-level, not in dedicated subsections.
Problem:
Virtual lines above a line where a fold starts show `foldopen` in
`foldcolumn`.
Solution:
Check if the line below the virtual one is inside a fold that starts
higher up or if it's the start of a fold. In the latter case, don't show
anything in `foldcolumn` for the virtual line.
refactor: lint
text-object-define is a pattern I found in tpope's plugins (e.g.
https://github.com/tpope/vim-jdaddy) which shows an elegant way to
define a text-object. (Any mistakes in the example are my fault.)
Problem:
Our documentation is incomplete or inconsistent in several ways:
- Some public APIs lack corresponding validators.
- Some public APIs lack usage examples.
- The meaning of some return values or parameters is not clearly explained.
Solution:
Add the missing validators, examples, and clarifications.
Problem:
- To share logic, creating a `vim.Range` currently creates two `vim.Pos` values
as intermediates, which causes unnecessary table allocations.
- `pos.lua` and `range.lua` contain some overlapping logic.
Solution:
Add `vim.pos._util`, a module for handling
positions represented directly by `row` and `col`.
Problem:
- A window can only have one cursor, ranges selected by the cursor are typically
obtained by marks like ">" and "<", instead of calling get_cursor() twice.
- `vim.Range` is described as end-exclusive,
but the current `range.cursor()`/`range:to_cursor()` are end-inclusive.
- Conversion between `vim.Range` and mark-indexed range can be done by
`range.mark()`/`range:to_mark()`
Solution:
Remove `range.cursor()` and `range:to_cursor()`,
Problem: `nvim_exec_autocmds({ buf = ... })` matches the target buffer, but callbacks and modelines run with the caller buffer current rather than the target buffer.
Solution: Execute the buffered path in prepared target-buffer context and restore the caller afterward.
Problem: To goto or delete a bookmark, one needs to prefix a count
for the bookmark number (e.g., "2gb" to open bookmark#2).
As the bookmark list gets or deletes entries, the numbers
keep changing, requiring listing the bookmarks with qb to
discover the desired bookmark number. Typing gb or mB
without a count targets g:netrw_bookmarklist[-1].
Solution: If no count is given to gb or mB, list all bookmarks and
prompt for a number using inputlist(), similar to tag jump
with g].
closes: vim/vim#2021135b767a090
Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
I submitted the PR vim/vim#20232 to resolve an undesired behavior in with the
highlighter inheriting from "django.vim" and "html.vim". After
further testing I noticed the re-declaration of `djangoOperators` in
"htmldjango" is not necessary, and my conclusions where a mistake from a
not-clean test environment.
This PR reverses the effect of the commit #f03155a.
related: vim/vim#20232
closes: vim/vim#20248d004cc4f89
Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
This fixes all clang 22 warnings of the form: "warning: diagnostic behavior
may be improved by adding the 'format(printf, 3, 4)' attribute to the
declaration of 'some_function'"
dialog_msg() was essentially a NULL-handling wrapper. but some callsites
already use their own NULL handling or NULL:s are impossible as the
value has already been assumed non-NULL. Non-locally assuming
a buffer size is also a code smell, especially if we can
just use "sizeof buff" without a wrapper.
append_redir() is... whatever it is.
Problem:
When mouse=n is set
- Dragging the mouse enters visual mode, and then stops listening for
mouse events.
- Double/Triple/Quad clicking performs selections.
- Clicking in visual mode moves the cursor (though not through the TUI).
Solution:
Explicitly gate mouse actions that affect visual mode with a check for
MOUSE_VISUAL. This matches the behavior described in :help mouse.
> If enabled for "v" (Visual mode) then double-click selects word-wise,
> triple-click makes it line-wise, and quadruple-click makes it
> rectangular block-wise.
Problem:
`aucmd_restbuf` must be guarded in case `aucmd_prepbuf` wasn't called.
Solution:
Update `aucmd_restbuf` to be a no-op if `aucmd_prepbuf` wasn't called.
This requires `aco` to be zero-initialized.
Problem: filetype: some html files are wrongly recognized as htmlangular
Solution: Use the \< atom to anchor ng-template and ng-content to start
of word (truffle)
Prevent false-positive htmlangular detection on words containing
'ng-template' or 'ng-content' as a substring (e.g. 'song-template',
'sing-content'). Anchor both branches with \< to require a word start,
matching the \<DTD\s\+XHTML\s idiom used five lines below.
related: neovim/neovim#39778.
closes: vim/vim#20246354ab1a69e
Co-authored-by: truffle <truffleagent@gmail.com>
Problem:
Visual selection could end up in the wrong place after
nvim_buf_set_text or nvim_buf_set_lines. In some delete cases,
Visual.lnum was already clamped before the line shift happened, so the
adjustment got skipped.
Solution:
Split fix_cursor_cols into reusable fix_pos_col logic and reuse it
for Visual updates. Also adjust Visual.lnum before changed_lines so
the shift uses the original position before final clamping.
Problem:
Various "unused function" warnings when building `map_defs.h`.
https://github.com/neovim/neovim/issues/26452
Solution:
Removed unused `MAP_DECLS(T, U)` specializations, their generated symbols, and
2 obsolete constants.
Problem:
Ranges represented by marks are usually end-inclusive,
but the range utilities we provided are end-exclusive.
Solution:
Add pos:to_mark(), pos.mark(), range:to_mark(), and range.mark().