Prepare for https://github.com/neovim/tree-sitter-vimdoc/pull/108 which improves
`{arg}` highlighting in many common cases:
vim.foo({bar})
vim.foo( {bar})
nvim_foo({bar})
nvim_foo({bar},{baz})
nvim_foo({bar}, {baz})
foo[{buf}]
The tradeoff is that things like `"[{"` are flagged as parse errors.
We could avoid if we drop support for `foo[{buf}]`, but that is rather common
(see `builtin.txt`).
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.
This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
Co-authored by: zeertzjq <zeertzjq@outlook.com>
Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com>
Co-authored by: nobe4 <nobe4@users.noreply.github.com>
- docs: mention --luadev-mod to run with lua runtime files
When changing a lua file in the ./runtime folder, a new contributor
might expect changes to be applied to the built Neovim binary.
Problem: Having utf16idx() rounding up is inconvenient.
Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closesvim/vim#12523)
95707037af
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Update runtime files
10e8ff9b26
Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
may also be used).
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: charidx() and utf16idx() result is not consistent with byteidx().
Solution: When the index is equal to the length of the text return the
lenght of the text instead of -1. (Yegappan Lakshmanan,
closesvim/vim#12503)
577922b917
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
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: 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>
Problem: There is no way to get a list of swap file names.
Solution: Add the swapfilelist() function. Use it in the test script to
clean up. Remove deleting individual swap files.
c216a7a21a
vim-patch:9.0.1005: a failed test may leave a swap file behind
Problem: A failed test may leave a swap file behind.
Solution: Delete the swap file to avoid another test to fail. Use another
file name.
d0f8d39d20
Cherry-pick test_window_cmd.vim changes from patch 8.2.1593.
Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
6f14da15ac
vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry
Problem: Dec mouse test fails without gnome terminfo entry.
Solution: Check if there is a gnome entry. Also fix 'acd' test on
MS-Windows. (Dominique Pellé, closesvim/vim#9282)
f589fd3e10
Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cleaning up after writefile() is a hassle.
Solution: Add the 'D' flag to defer deleting the written file. Very useful
in tests.
806a273f3c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: It is not easy to get information about a script.
Solution: Make getscriptinf() return the version. When selecting a specific
script return functions and variables. (Yegappan Lakshmanan,
closesvim/vim#10991)
2f892d8663
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getscriptinfo() does not include the version. Cannot select
entries by script name.
Solution: Add the "version" item and the "name" argument. (Yegappan
Lakshmanan, closesvim/vim#10962)
520f6ef60a
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Cannot easily get the list of sourced scripts.
Solution: Add the getscriptinfo() function. (Yegappan Lakshmanan,
closesvim/vim#10957)
f768c3d19c
Cherry-pick usr_41.txt change from a later runtime update.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432#9833https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
mkdir foo
TMPDIR=./foo nvim
:echo tempname()
!rm -r foo
:echo tempname()
tempname() still uses the foo path even though it was deleted.
Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.
Rejected in Vim for performance reasons:
https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0Jhttps://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.
Fixes#1432Fixes#9833Fixes#11250
Related: stdpath("run") f50135a32e
Problem: Value of MAXCOL not available in Vim script.
Solution: Add v:maxcol. (Naohiro Ono, closesvim/vim#9451)
56200eed62
The variable is always 2147483647, but introducing it makes functions
easier to document.
Co-authored-by: naohiro ono <obcat@icloud.com>
Problem: readblob() returns empty when trying to read too much.
Solution: Return what is available.
5b2a3d77d3
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: readblob() cannot read from character device.
Solution: Use S_ISCHR() to not check the size. (Ken Takata, closesvim/vim#11407)
43625762a9
S_ISCHR is always defined in Nvim.
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: readblob() always reads the whole file.
Solution: Add arguments to read part of the file. (Ken Takata,
closesvim/vim#11402)
11df3aeee5
Remove trailing whitespace in test as done in patch 9.0.1257.
Move the help for rand() before range().
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: Vim9: it is not possible to extend a dictionary with different
item types.
Solution: Add extendnew(). (closesvim/vim#7666)
b0e6b51364
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Code and help for indexof() is not ideal.
Solution: Refactor the code, improve the help. (Yegappan Lakshmanan,
closesvim/vim#10908)
3fbf6cd355
Skip CHECK_LIST_MATERIALIZE and set_vim_var_type().
Use tv_list_uidx() instead of lv_idx.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Finding value in list may require a for loop.
Solution: Add indexof(). (Yegappan Lakshmanan, closesvim/vim#10903)
b218655d5a
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Vim9: flatten() always changes the list type.
Solution: Disallow using flatten() and add flattennew().
3b69006973
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Make it more clear that on unix the "pipe" mode of sockconnect uses unix
local domain sockets, not named pipes (FIFOs) which are not currently
supported.
See discussion in #22080.
Signed-off-by: Thayne McCombs
Problem: :runtime completion can be further improved.
Solution: Also complete the {where} argument values and adjust the
completion for that. (closesvim/vim#11874)
5c8771bc5a
Problem: Cannot read back what setcellwidths() has done.
Solution: Add getcellwidths(). (Kota Kato, closesvim/vim#11837)
66bb9ae70f
Co-authored-by: Kota Kato <github@kat0h.com>