Problem: Making a mapping work in all modes is complicated.
Solution: Add the <Cmd> special key. (Yegappan Lakshmanan, closesvim/vim#7282,
closes 4784, based on patch by Bjorn Linse)
957cf67d50
Change docs to match Vim if it's wording is better.
Change error numbers to match Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Current behaviour of `:Man` is to only work with "number" sections.
This is caused by wrong assumptions about man sections naming.
Also, there was similar assumption about length of section dirs
in `paths` variable.
fixes#23485
Signed-off-by: Vadim Misbakh-Soloviov <git@mva.name>
This replaces the custom `health{Error,Warning,Success}` highlight
groups with `Diagnostic{Error,Warning,Ok}`, which are defined by
default. Removes the link for `healthHelp`, which was no longer
actually used after #20879.
perf(lsp): load buffer contents once when processing semantic token responses
Using _get_line_byte_from_position() for each token's boundaries was a
pretty huge bottleneck, since that function would load individual buffer
lines via nvim_buf_get_lines() (plus a lot of extra overhead). So each
token caused two calls to nvim_buf_get_lines() (once for the start
position, and once for the end position).
For semantic tokens, we only attach to buffers that have already been
loaded, so we can safely just get all the lines for the entire buffer at
once, and lift the rest of the _get_line_byte_from_position()
implementation directly while bypassing the part that loads the buffer
line.
While I was looking at get_lines (used by _get_line_byte_from_position),
I noticed that we were checking for non-file URIs before we even looked
to see if we already had the buffer loaded. Moving the buffer-loaded
check to be the first thing done in get_lines() more than halved the
average time spent transforming the token list into highlight ranges vs
when it was still using _get_line_byte_from_position. I ended up
improving that loop more by not using get_lines, but figured the
performance improvement it provided was worth leaving in.
Problem: Using inclusive index for slice is not always desired.
Solution: Add the slice() method, which has an exclusive index. (closes
vim/vim#7408)
6601b62943
Cherry-pick a line in docs added later.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: string indexes are counted in bytes.
Solution: Use character indexes. (closesvim/vim#6574)
e3c37d8ebf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Not enough characters accepted for 'spellfile'.
Solution: Add vim_is_fname_char() and use it for 'spellfile'.
bc49c5f48f
Cherry-pick related doc update from Vim runtime.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Divide by zero with 'smoothscroll' set and a narrow window.
Solution: Bail out when the window is too narrow.
870219c58c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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.
f6196f4244
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.
bbbda8fd81
Co-authored-by: Bram Moolenaar <Bram@vim.org>
When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed
Problem: Heredoc for interfaces does not support "trim".
Solution: Update the script heredoc support to be same as the :let command.
(Yegappan Lakshmanan, closesvim/vim#5916)
6c2b7b8055
Packing and unpacking return values impairs performance considerably.
In an attempt to avoid creating tables as much as possible we can
instead pass return values between functions (which does not require
knowing the number of values a function might return). This makes the
code more complex, but improves benchmark numbers non-trivially.
fix(extmarks): disallow removing extmarks in on_lines callbacks
decor_redraw_start (which runs before decor_providers_invoke_lines) gets
references for the extmarks on a specific line. If these extmarks are
deleted in on_lines callbacks then this results in a heap-use-after-free
error.
Fixes#22801
Problem: no functions for converting from/to UTF-16 index.
Solution: Add UTF-16 flag to existing funtions and add strutf16len() and
utf16idx(). (Yegappan Lakshmanan, closesvim/vim#12216)
67672ef097
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Behavior of exists() in a :def function is unpredictable.
Solution: Add exists_compiled().
267359902c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot get the first screen column of a character.
Solution: Let virtcol() optionally return a list. (closesvim/vim#10482,
closesvim/vim#7964)
0f7a3e1de6
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closesvim/vim#11009)
04c4c5746e
Cherry-pick removal of E922 from docs from patch 9.0.1403.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1478: filetypes for *.v files not detected properly
Problem: Filetypes for *.v files not detected properly.
Solution: Use the file contents to detect the filetype. (Turiiya,
closesvim/vim#12281)
80406c2618
Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>