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>
Problem: getcompletion() does not work properly when 'wildoptions
contains "fuzzy".
Solution: Do not use addstar(). (Yegappan Lakshmanan, closesvim/vim#9992,
closesvim/vim#9986)
e7dd0fa2c6
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: No command line completion for :breakadd and :breakdel.
Solution: Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
closesvim/vim#9950)
6e2e2cc95b
Problem: Help tag generation picks up words in code examples.
Solution: Skip over examples. (Carlo Teubner, closesvim/vim#10813)
ddab3ce345
Also fix mistakes in help files.
Co-authored-by: Carlo Teubner <carlo@cteubner.net>
Problem: getbufline() is inefficient for getting a single line.
Solution: Add getbufoneline().
ce30ccc06a
Cherry-pick part of usr_41.txt from patch 8.1.1628.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: setline() gives an error for some types.
Solution: Allow any type, convert each item to a string.
3445320839
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>
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>
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: 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: 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.