Closes#18687
This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.
It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
Problem: Only a change in the current window triggers the WinScrolled
event.
Solution: Trigger WinScrolled if any window scrolled or changed size.
(issue vim/vim#11576)
0a60f79fd0
Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
Problem: A silent mapping may cause dots on the command line.
Solution: Don't show dots for completion if they are not going to be removed
again. (closesvim/vim#11501)
698a00f55d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: col() and charcol() only work for the current window.
Solution: Add an optional winid argument. (Yegappan Lakshmanan,
closesvim/vim#11466, closesvim/vim#11461)
4c8d2f02b3
Cherry-pick test_functions.vim change from patch 8.2.0633.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Solution for "!!sort" in closed fold is not optimal.
Solution: Use a different range instead of the subtle difference in handling
a range with an offset. (issue vim/vim#11487)
9954dc39ea
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Update runtime files
76db9e0763
- `col()`'s example was changed to use `:echowin` so that the message can be
seen with `showmode`. Use "\n" to force a hit-enter instead as `:echowin`
isn't ported.
- Replace interpolated string usage in syntax/modula3.vim (not ported).
- Add a space after the `wincmd =` examples in `*CTRL-W_=*` so that the inlined
code is highlighted properly when followed by a full stop.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
fix(vim.ui.input): return empty string when inputs nothing
The previous behavior of `vim.ui.input()` when typing <CR> with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.
Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.
Adds a `name` key to the opts dict passed to Lua command callbacks
created using `nvim_create_user_command()`. This is useful for when
multiple commands use the same callback.
Note that this kind of behavior is not as strange as one might think,
even some internal Neovim commands reuse the same internal C function,
differing their behavior by checking the command name. `substitute`,
`smagic` and `snomagic` are examples of that.
This will also be useful for generalized Lua command preview functions
that can preview a wide range of commands, in which case knowing the
command name is necessary for the preview function to actually be able
to execute the command that it's supposed to preview.
Problem: Cannot assign a lambda to an option that takes a function.
Solution: Automatically convert the lambda to a string. (Yegappan
Lakshmanan, closesvim/vim#9286)
6409553b6e
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
- `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if
they do not exist
- Note: `:foo ++…` is usually for options. No existing options have
a single-char abbreviation (presumably by design), so it's safe to
special-case `++p` here.
- Same for `writefile(…, 'foo/bar/baz.txt', 'p')`
- `BufWriteCmd` can see the ++p flag via `v:cmdarg`.
closes#19884
Problem: Crash when 'tagfunc' closes the window.
Solution: Bail out when the window was closed.
ccfde4d028
Add docs for E1299 from Vim runtime.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution: Implement lambda support. (Yegappan Lakshmanan, closesvim/vim#9257)
8658c759f0
Comment out Vim9 script in tests.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Cannot use Vim9 lambda for 'tagfunc'.
Solution: Make it work, add more tests. (Yegappan Lakshmanan, closesvim/vim#9250)
05e59e3a9f
Omit Vim9 script in code and comment out in tests.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Cannot use a lambda for 'tagfunc'.
Solution: Use 'tagfunc' like 'opfunc'. (Yegappan Lakshmanan, closesvim/vim#9204)
19916a8c89
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Cannot make 'breakindent' use a specific column.
Solution: Add the "column" entry in 'breakindentopt'. (Christian Brabandt,
closesvim/vim#10362, closesvim/vim#10325)
e7d6dbc572
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot have expandcmd() give an error message for mistakes.
Solution: Add an optional argument to give errors. Fix memory leak when
expanding files fails. (Yegappan Lakshmanan, closesvim/vim#10071)
2b74b6805b
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: strchars() defaults to counting composing characters.
Solution: Add strcharlen() which ignores composing characters.
70ce8a1561
Use docs from latest Vim instead.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No error if engine selection atom is not at the start.
Solution: Give an error. (Christian Brabandt, closesvim/vim#10439)
360da40b47
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: wrong argument for append() results in two errors.
Solution: Check did_emsg. Also for setline(). Adjust the help for
appendbufline().
8b6256f6ec
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: test_fails() does not check the context of the line number.
Solution: Use another argument to specify the context of the line number.
9bd5d879c2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: error for list index uses wrong line number.
Solution: Set source line number. (closesvim/vim#6724) Add a way to assert the
line number of the error with assert_fails().
1d634542cf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: assert_fails() checks the last error message.
Solution: Check the first error, it is more relevant. Fix all the tests
that rely on the old behavior.
9b7bf9e98f
Skip test_listener.vim, test_textprop.vim, test_viminfo.vim.
Skip test_python2.vim: affected line fails and hasn't been ported.
Skip test_python3.vim: affected lines fail and haven't been ported.
Skip CHECK_LIST_MATERIALIZE.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Insufficient testing for invalid function arguments.
Solution: Add more tests. (Yegappan Lakshmanan, closesvim/vim#5988)
99fa721944
Omit test_listener.vim: changed again in patch 8.2.1183.
Omit test_textprop.vim: changed again in patch 8.2.1183.
Cherry-pick quickfix feature checks from patch 8.1.2373.
Omit Test_saveas() change: duplicate and removed in patch 8.2.0866.
Problem: Various functions not properly tested.
Solution: Add more tests, especially for failures. (Yegappan Lakshmanan,
closesvim/vim#5843)
0e05de4622
Cherry-pick test changes from patch 8.2.0427 and skip Test_has().
Cherry-pick Test_complete_wildmenu() change from patch 8.2.4339.
Problem: If 'endofline' is set the CTRL-Z may be written in the wrong
place.
Solution: Write CTRL-Z at the end of the file. Update the help to explain
the possibilities better. (Ken Takata, closesvim/vim#11486)
3af982196b
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: Vim9: return type of readfile() is any.
Solution: Add readblob() so that readfile() can be expected to always
return a list of strings. (closesvim/vim#7671)
c423ad77ed
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: CTRL-Z at end of file is always dropped.
Solution: Add the 'endoffile' option, like the 'endofline' option.
(closesvim/vim#11408, closesvim/vim#11397)
Cherry-pick test_fixeol.vim changes from patch 8.2.1432.
Cherry-pick 'endoffile' changes from latest Vim runtime update.
fb0cf2357e
vim-patch:f0b567e32a46
Revert unintended Makefile change
f0b567e32a
vim-patch:72c8e3c070b3
Fix wrong struct access for member.
72c8e3c070
vim-patch:3f68a4136eb9
Add missing entry for the 'endoffile' option.
3f68a4136e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Messages in globals.h not translated, xgettext on MS-Windows not
fully supported.
Solution: Add globals.h to list of input files. Update MS-Windows makefiles
to improve message translations. (Ken Takata, closesvim/vim#6858)
fa57335e53
Also update gettext() docs to match latest Vim.
Problem: Cannot translate messages in a Vim script.
Solution: Add gettext(). Try it out for a few messages in the options
window.
0b39c3fd4c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Unlike `:autocmd`, `nvim_create_autocommand()` does not expand
environment variables in the `pattern`, which is unexpected.
Solution: Add a note to the documentation explaining this and suggesting
using `expand()` explicitly.
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first
Solution:
Constrain docstring annotations.
Fix return types.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: Captures used by bundled parsers are not highlighted by default
Solution: Add links to default groups
A link is added for a capture if
* there is a default group of the same name (e.g., `@tag` -> `Tag`)
* it's used in a bundled query and doesn't have a reasonable fallback
(e.g., `@text.literal`)
Also add all linked groups to the treesitter docs.
Made obsolete by now graduated `filetype.lua` (enabled by default).
Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
Problem: Some Ex commands are not in the help index.
Solution: Add the missing commands. Add a script to check all Ex commands
are in the help index. (Yee Cheng Chin, closesvim/vim#11371)
b77bdce120
Only port index.txt docs for :star and :horizontal.
- Improve generated HTML by updating parser which includes fixes for
single "'" and single "|":
https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
NOT including whitespace in nodes.
- But this means we need to restore the getws() function which scrapes
leading whitespace from the original input (buffer).
Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
their table columns/contents because the leading whitespace is not
emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.
Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
- supports `keycode`
- fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297
fix https://github.com/neovim/neovim.github.io/issues/297
vim-patch:9.0.0445: when opening/closing window text moves up/down
Problem: When opening/closing window text moves up/down.
Solution: Add the 'splitscroll' option. When off text will keep its
position as much as possible.
29ab524358
vim-patch:9.0.0455: a few problems with 'splitscroll'
Problem: A few problems with 'splitscroll'.
Solution: Fix 'splitscroll' problems. (Luuk van Baal, closesvim/vim#11117)
5ed391708a
vim-patch:9.0.0461: 'scroll' is not always updated
Problem: 'scroll' is not always updated.
Solution: Call win_init_size() at the right place.
470a14140b
vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution: Temporarily set 'splitscroll' when jumping back to the original
window. (closesvim/vim#11128)
e697d48890
vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off
Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closesvim/vim#11134)
3735f11050
vim-patch:9.0.0478: test for 'splitscroll' takes too much time
Problem: Test for 'splitscroll' takes too much time.
Solution: Only test some of the combinations. (Luuk van Baal, closesvim/vim#11139)
594f9e09cd
vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help
window closed.
Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal,
closesvim/vim#11150)
d5bc762dea
vim-patch:9.0.0505: various problems with 'nosplitscroll'
Problem: Various problems with 'nosplitscroll'.
Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closesvim/vim#11166)
faf1d412f5
vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closesvim/vim#11185)
20e58561ab
vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly
Problem: With 'nosplitscroll' folds are not handled correctly.
Solution: Take care of closed folds when moving the cursor. (Luuk van Baal,
closesvim/vim#11234)
7c1cbb6cd4
vim-patch:9.0.0605: dump file missing
Problem: Dump file missing.
Solution: Add the missing dump file. (issue vim/vim#11234)
439a2ba174
vim-patch:9.0.0647: the 'splitscroll' option is not a good name
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closesvim/vim#11258)
13ece2ae1d
vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"
Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution: Check the botline is not too large. (Luuk van Baal,
closesvim/vim#11293, closesvim/vim#11292)
346823d3e5
The old behaviour (e.g. via `set display-=msgsep`) will not be available.
Assuming that messages always are being drawn on msg_grid
(or not drawn at all, and forwarded to `ext_messages` enabled UI)
will allows some simplifcations and enhancements moving forward.
Problem:
The {foo} parameters listed in `:help api` and similar generated docs,
are intended to be a "list" but they aren't prefixed with a list symbol.
This prevents parsers from understanding the list, which forces
generators like `gen_help_html.lua` to use hard-wrapped/preformatted
layout instead of a soft-wrapped "flow" layout.
Solution:
Modify gen_vimdoc.py to prefix {foo} parameters with a "•" symbol.
Problem: Cannot specify another character to use instead of '@' at the end
of the window.
Solution: Add "lastline" to 'fillchars'. (Martin Tournoij, closesvim/vim#11264,
closesvim/vim#10963)
4ba5f1dab6
Use latest code in drawscreen.c instead.
Problem: matchaddpos() can get slow when adding many matches.
Solution: Update the next available match ID when manually picking an ID and
remove check if the available ID can be used. (idea by Rick Howe)
9f573a8df0
Reverts #16271
Fixs #15913
Problem:
Since #16271, `make_filter_cmd` uses `Start-Process` cmdlet to execute the user
provided shell command for `:%!`. `Start-Process` requires the command to be
split into the shell command and its arguments. This was implemented in #19268
by parsing (splitting the user-provided command at the first space) which didn't
handle cases such as --
- commands with escaped space in their filepath
- quoted commands with space in their filepath
Solution: Use piping.
The total shell command formats (excluding noise of unimportant parameters):
1. Before #16271
```powershell
pwsh -C "(shell_cmd) < tmp.in | 2>&1 Out-File -Encoding UTF8 <tmp.out>"
# not how powershell commands work
```
2. Since #16271
```powershell
pwsh -C "Start-Process shell_cmd -RedirectStandardInput <tmp.in> -RedirectStandardOutput <tmp.out>"
# doesn't handle executable path with space in it
# doesn't write error to <tmp.out>
```
3. This PR
```powershell
pwsh -C "& { Get-Content <tmp.in> | & 'path\with space\to\shell_cmd.exe' arg1 arg2 } 2>&1 | Out-File -Encoding UTF8 <tmp.out>"
# also works with forward slash in the filepath
# also works with double quotes around shell command
```
After this PR, the user can use the following formats:
:%!c:\Program` Files\Git\usr\bin\sort.exe
:%!'c:\Program Files\Git\usr\bin\sort.exe'
:%!"c:\Program Files\Git\usr\bin\sort.exe"
:%!"c:\Program` Files\Git\usr\bin\sort.exe"
They can even chain different commands:
:%!"c:\Program` Files\Git\usr\bin\sort.exe" | sort.exe -r
But if they want to call a stringed executable path, they have to provide the
Invoke-Command operator (&). In fact, the first stringed executable path also
needs this & operator, but this PR adds that behind the scene.
:%!"c:\Program` Files\Git\usr\bin\sort.exe" | sort.exe -r | & 'c:\Program Files\Git\usr\bin\sort.exe'
## What this PR solves
- Having to parse the user-provided bang ex-command (for splitting into shell
cmd and its args).
- Removes a lot of human-unreadable `#ifdef` blocks.
- Accepting escaped spaces in executable path.
- Accepting quoted string of executable path.
- Redirects error and exception to tmp.out (exception for when `wrong_cmd.exe
not found`)
## What this PR doesn't solve
- Handling wrongly escaped path to executable, which the user may pass because
of cmdline tab-completion. #18592
## Edge cases
- (Not handled) If the user themself provides the `&` sign (means `call
this.exe` in powershell)
- (Not handled) Use `-Encoding utf8` parameter for `Get-Content`?
- (Handled) Doesn't write to tmp.out if shell command is not found.
- fix: use anonymous function (`{wrong_cmd.exe}`).
## Changes other than `make_filter_cmd()` function
- Encoding for piping to external executables. See BOM-less UTF8:
https://github.com/PowerShell/PowerShell/issues/4681
Problem:
`Start-Process` requires the command to be split into the shell
command and its arguments. Previously it was done by parsing, which
didn't handle cases such as
- commands with escaped space in their filepath
- quoted commands with space in their filepath
Solution:
Use
- `pwsh -Command` instead of `Start-Process`
- `Get-Content` instead of `-RedirectStandardInput`
- `Out-File` instead of `-RedirectStandardOutput`
I don't think using an integer as a NUL-terminated string can work on
big-endian systems, at least.
This is also not tested. Add a test.
Also fix a mistake in the docs of nvim_parse_cmd.
Problem:
Cannot opt-out of "WARNING: The file has been changed since reading
it!!!", even with ":write!".
Solution:
Change ":write!" to skip the warning.
closes#7270
fix(treesitter): get_captures_at_position returns metadata
Return the full `metadata` table for the capture instead of just the
priority.
Further cleanup of related docs.
Makes it possible to use `vim.fs.find` to find files where only a
substring is known.
This is useful for `vim.lsp.start` to get the `root_dir` for languages
where the project-file is only known by its extension, not by the full
name.
For example in .NET projects there is usually a `<projectname>.csproj`
file in the project root.
Example:
vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true })
Problem: There is no easy way to translate a string with a key code into a
readable string.
Solution: Add the keytrans() function. (closesvim/vim#11114)
cdc839353f
vim-patch:7b2d87220c6c
Add missing part of patch
7b2d87220c
Problem: There is no way to get the byte index from a virtual column.
Solution: Add virtcol2col(). (Yegappan Lakshmanan, closesvim/vim#10477,
closesvim/vim#10098)
5a6ec10cc8
Cherry-pick tv_check_for_number_arg() from Vim.
Cherry-pick pathshorten() doc change.
Use the first, not last, query for a language on runtimepath. Typically,
this implies that a user query will override a site plugin query, which
will override a bundled runtime query.
Problem: Treesitter queries for a given language in runtime were merged together,
leading to errors if they targeted different parser versions (e.g., bundled viml queries
and those shipped by nvim-treesitter).
Solution: Runtime queries now work as follows:
* The last query in the rtp without `; extends` in the header will be used as the base query
* All queries (without a specific order) with `; extends` are concatenated with the base query
BREAKING CHANGE: queries need to be updated if they are meant to extend other queries
- Added 'spell' option to extmarks:
Extmarks with this set will have the region spellchecked.
- Added 'noplainbuffer' option to 'spelloptions':
This is used to tell Neovim not to spellcheck the buffer. The old
behaviour was to spell check the whole buffer unless :syntax was set.
- Added spelling support to the treesitter highlighter:
@spell captures in highlights.scm are used to define regions which
should be spell checked.
- Added support for navigating spell errors for extmarks:
Works for both ephemeral and static extmarks
- Added '_on_spell_nav' callback for decoration providers:
Since ephemeral callbacks are only drawn for the visible screen,
providers must implement this callback to instruct Neovim which
regions in the buffer need can be spell checked.
The callback takes a start position and an end position.
Note: this callback is subject to change hence the _ prefix.
- Added spell captures for built-in support languages
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* Add vim.treesitter.start() for starting treesitter highlighting via
ftplugin or autocommand (can be extended later for fold, indent,
matchpairs, ...)
* Add vim.treesitter.stop() for manually stopping treesitter
highlighting
* Enable treesitter highlighting for Lua if
`vim.g.ts_highlight_lua = true` is set in `init.lua`
Problem: Cannot force getting MouseMove events.
Solution: Add the 'mousemoveevent' option with implementaiton for the GUI.
(Ernie Rael, closesvim/vim#10044)
c4cb544cd5
This only ports the docs and the option variable.
The following commits will actually implement it as a UI option.
Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
Problem: ":wincmd =" equalizes in two directions.
Solution: Make ":vertical wincmd =" equalize vertically only and
":horizontal wincmd =" equalize horizontally only.
21c3a80a7f
Problem: People are confused about `vim.o` and `vim.opt`
Solution: Clarify that `vim.o` is the default interface, with `vim.opt`
specifically meant for interacting with list-style options.
vim-patch:9.0.0285: it is not easy to change the command line from a plugin
Problem: It is not easy to change the command line from a plugin.
Solution: Add setcmdline(). (Shougo Matsushita, closesvim/vim#10869)
07ea5f1509
Problem: The tiny version has the popup menu but not 'wildmenu'.
Solution: Graduate the wildmenu feature.
5416232707
N/A patches for version.c:
vim-patch:9.0.0281: build failure without the +eval feature
Problem: Build failure without the +eval feature.
Solution: Add #ifdef.
58dcbf1c65
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.
The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)
For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
Problem: bufload() reads a file even if the name is not a file name. (Cyker
Way)
Solution: Do not read the file when the buffer name is not a file name.
(closesvim/vim#10975)
2eddbacd6d
Previously if a highlight group with a name outside the regexp
[a-zA-Z0-9_] was defined, Nvim would emit an "invalid character"
warning message. This was annoying for Lua scripts, as it was very hard
to debug what line of code was triggering this message since it didn't
produce a stack trace.
This has now been promoted to an error with the code E5248.
Additionally the ASCII character period ('.') and at-sign ('@') have
been added to the allowed list of characters of a highlight group name
to support the application of defining hierarchical highlight groups,
e.g. 'TS.keyword'.
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
Problem: Cannot use expand() to get the script name.
Solution: Support expand('<script>'). (closesvim/vim#10121)
6013d0045d
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
vim-patch:8.1.1915: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method.
1a3a89168d
Move debugbreak() to the right place.
vim-patch:8.1.1921: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method.
a4208966fb
vim-patch:8.1.1953: more functions can be used as a method
Problem: More functions can be used as a method.
Solution: Allow more functions to be used as a method.
f9f24ce7a0
Omit test_termcodes.vim: cannot be used and superseded by later patches.
Cherry-pick test_bufline.vim change from patch 8.1.1993.
Problem: 'wildmenu' only shows few matches.
Solution: Add the "pum" option: use a popup menu to show the matches.
(Yegappan Lakshmanan et al., closesvim/vim#9707)
3908ef5017
Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
Problem: Cannot use a lambda for 'operatorfunc'.
Solution: Support using a lambda or partial. (Yegappan Lakshmanan,
closesvim/vim#8775)
777175b0df
Omit duplicate docs. It's removed in patch 8.2.3623.
Nvim doesn't seem to need callback_set() as it was omitted when patch 8.1.1437
was first ported.
docs(lua): update vim.{go,bo,wo} documentation
* document indexing by buffer/window handle
* correct wrapper information (`nvim_buf_{g,s}et_value` now)
* make clear what is considered "invalid key" (consistently)
Allows preview callbacks to modify multiple buffers in order to show the
preview. Previously, if multiple buffers were modified, only the current
buffer would have its state restored. After this change, all buffers
have their state restored after preview.
Closes#19103.
This starts a soft phase-out of `buf_request`.
`buf_request` is quite error prone:
- Positional `params` depend on the client because of the
`offset_encoding`. Currently if there is one client using UTF-8 offset
encoding and another using UTF-16, the positions in the request are
wrong for one of the clients. To solve this the params would need to
be created per client instead of once for all of them.
- `handler` is called *per* client but many users of it assume it is
only called once.
This can lead to a "select n + 1"
kind of problem, where the handler makes another call to `buf_request`,
multiplying the amount of requests.
(There are in fact still some places where this happens in core)
Or it leads to erratic behavior if called multiple times (E.g. the
quicklist list flickering & being overwritten)
(See hover or references implementation)
`buf_request_all` returns an aggregate of the responses which is more
sensible as it avoids this problem.
For off-spec extensions it also has the problem that it sends requests to
clients which cannot handle a given request.
Given that `buf_request` is in use by a lot of plugins this starts a
soft-phase out. Planned Steps:
- Remove from docs
- Provide an alternative, either `buf_request_all`, maybe with
extensions (params being a function), or an entirely new method.
- Mark as deprecated in 0.9
- Remove in 0.10
To note:
- `buf_request_all` currently isn't ideal either because it suffers from
the `params` problem as well.
- This implies that the `vim.lsp.with` pattern will die, because the
global handlers as they are don't fit a multi-client model, as most of
the time an aggregate is needed.
Let :wincmd command accept a count like what its documentation suggests.
Previously it could only accept a range, which led to some ambiguity on
which attribute should be used when executing :wincmd using nvim_cmd.
Closes#19662.
Also fix a typo in a related Vim test:
vim-patch:9.0.0223: typo in diffmode test
Problem: Typo in diffmode test.
Solution: Fix the typo. (closesvim/vim#10932)
5fd6ab820b