From 6dcdec8042e69c151f40974486b0e3d254596e6c Mon Sep 17 00:00:00 2001 From: Daniel Steinberg Date: Sat, 29 Jan 2022 07:37:07 -0500 Subject: vim-patch:8.2.4052: not easy to resize a window from a plugin (#17028) --- src/nvim/eval.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index e445a08227..0b460fe887 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -413,6 +413,8 @@ return { win_gotoid={args=1, base=1}, win_id2tabwin={args=1, base=1}, win_id2win={args=1, base=1}, + win_move_separator={args=2, base=1}, + win_move_statusline={args=2, base=1}, win_screenpos={args=1, base=1}, win_splitmove={args={2, 3}, base=1}, winbufnr={args=1, base=1}, -- cgit From baec0d3152afeab3007ebb505f3fc274511db434 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Fri, 28 Jan 2022 15:42:19 +0100 Subject: feat(provider)!: remove support for python2 and python3.[3-5] These versions of python has reached End-of-life. getting rid of python2 support removes a lot of logic to support two incompatible python versions in the same version. --- src/nvim/eval.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 0b460fe887..18967b80f2 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -270,8 +270,8 @@ return { pum_getpos={}, pumvisible={}, py3eval={args=1, base=1}, - pyeval={args=1, base=1}, - pyxeval={args=1, base=1}, + pyeval={args=1, base=1, func="f_py3eval"}, + pyxeval={args=1, base=1, func="f_py3eval"}, perleval={args=1, base=1}, range={args={1, 3}, base=1}, readdir={args={1, 2}, base=1}, -- cgit From d746f5aa418f86828aef689a2c4f8d5b53c9f7de Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Mon, 6 Dec 2021 20:50:29 +0000 Subject: feat(eval): partially port v8.2.0878 Problem: No reduce() function. Solution: Add a reduce() function. (closes vim/vim#5481) https://github.com/vim/vim/commit/85629985b71035608a37ba3bde86968481490d46 Needs CHECK_LIST_MATERIALIZE from v8.2.0751 (and range_list_materialize from 8.2.0149). Move e_reduceempty to funcs.c, as it's only used there. Make it static. Use tv_blob_len, tv_list_len == 0 for empty checks. Replace vim_memset(&funcexe, 0, ...) with FUNCEXE_INIT. Leave li initially undefined (tv_list_first returns NULL if list is NULL). This patch has a memory leak fixed by v8.2.0882. --- src/nvim/eval.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 18967b80f2..e00a14fca7 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -276,6 +276,7 @@ return { range={args={1, 3}, base=1}, readdir={args={1, 2}, base=1}, readfile={args={1, 3}, base=1}, + reduce={args={2, 3}, base=1}, reg_executing={}, reg_recording={}, reg_recorded={}, -- cgit From 22f0725aac300ed9b249f995df7889f6c203d1e0 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 9 Jan 2022 22:48:29 +0000 Subject: vim-patch:8.1.2342: random number generator in Vim script is slow Problem: Random number generator in Vim script is slow. Solution: Add rand() and srand(). (Yasuhiro Matsumoto, closes vim/vim#1277) https://github.com/vim/vim/commit/06b0b4bc27077013e9b4b48fd1d9b33e543ccf99 Add missing method call usage to builtin.txt. vim_time and test_settime is N/A. Add a modeline to test_random.vim. Use typval_T* over listitem_T* vars so we don't need to use TV_LIST_ITEM_TV all over the place... Remove NULL list checks (tv_list_len covers this). --- src/nvim/eval.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 18967b80f2..ef2b8a0cc0 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -273,6 +273,7 @@ return { pyeval={args=1, base=1, func="f_py3eval"}, pyxeval={args=1, base=1, func="f_py3eval"}, perleval={args=1, base=1}, + rand={args={0, 1}, base=1}, range={args={1, 3}, base=1}, readdir={args={1, 2}, base=1}, readfile={args={1, 3}, base=1}, @@ -348,6 +349,7 @@ return { spellsuggest={args={1, 3}, base=1}, split={args={1, 3}, base=1}, sqrt={args=1, base=1, func="float_op_wrapper", data="&sqrt"}, + srand={args={0, 1}, base=1}, stdpath={args=1}, str2float={args=1, base=1}, str2list={args={1, 2}, base=1}, -- cgit From 8ba9f19961d8573dc851d3d5f2ec217ad2fb7b28 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Feb 2022 04:46:16 +0800 Subject: vim-patch:8.2.1727: a popup created with "cursorline" will ignore "firstline" Problem: A popup created with "cursorline" will ignore "firstline". Solution: When both "cursorline" and "firstline" are present put the cursor on "firstline". (closes vim/vim#7000) Add the "winid" argument to getcurpos(). https://github.com/vim/vim/commit/99ca9c4868bb1669706b9e3de9a9218bd11cc459 Skip popup window related code. Cherry-pick all of Test_getcurpos_setpos() from patch 8.2.0610. --- src/nvim/eval.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index ef2b8a0cc0..8590614a0a 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -151,7 +151,7 @@ return { getcmdtype={}, getcmdwintype={}, getcompletion={args={2, 3}, base=1}, - getcurpos={}, + getcurpos={args={0, 1}, base=1}, getcwd={args={0, 2}, base=1}, getenv={args=1, base=1}, getfontname={args={0, 1}}, -- cgit From 6ab71683d14a408e79f7cbda3a07ab65f76c6b35 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Feb 2022 04:46:16 +0800 Subject: vim-patch:8.2.2324: not easy to get mark en cursor posotion by character count Problem: Not easy to get mark en cursor posotion by character count. Solution: Add functions that use character index. (Yegappan Lakshmanan, closes vim/vim#7648) https://github.com/vim/vim/commit/6f02b00bb0958f70bc15534e115b4c6dadff0e06 --- src/nvim/eval.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 8590614a0a..5c85d764fb 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -71,6 +71,7 @@ return { chanclose={args={1, 2}}, chansend={args=2}, char2nr={args={1, 2}, base=1}, + charcol={args=1, base=1}, charidx={args={2, 3}, base=1}, chdir={args=1, base=1}, cindent={args=1, base=1}, @@ -144,6 +145,7 @@ return { getchangelist={args={0, 1}, base=1}, getchar={args={0, 1}}, getcharmod={}, + getcharpos={args=1, base=1}, getcharsearch={}, getcharstr={args={0, 1}}, getcmdline={}, @@ -152,6 +154,7 @@ return { getcmdwintype={}, getcompletion={args={2, 3}, base=1}, getcurpos={args={0, 1}, base=1}, + getcursorcharpos={args={0, 1}, base=1}, getcwd={args={0, 2}, base=1}, getenv={args=1, base=1}, getfontname={args={0, 1}}, @@ -312,8 +315,10 @@ return { serverstop={args=1}, setbufline={args=3, base=3}, setbufvar={args=3, base=3}, + setcharpos={args=2, base=2}, setcharsearch={args=1, base=1}, setcmdpos={args=1, base=1}, + setcursorcharpos={args={1, 3}, base=1}, setenv={args=2, base=2}, setfperm={args=2, base=1}, setline={args=2, base=2}, -- cgit From d65ee129143fedd43178c9be52095b5d2d06b5c2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Feb 2022 16:29:12 +0800 Subject: vim-patch:8.2.1741: pathshorten() only supports using one character Problem: pathshorten() only supports using one character. Solution: Add an argument to control the length. (closes vim/vim#7006) https://github.com/vim/vim/commit/6a33ef0deb5c75c003a9f3bd1c57f3ca5e77327e Cherry-pick a line in test from patch 8.2.0634. Use Nvim's config paths in docs. shorten_dir() returning a pointer looks a bit confusing here, as it is actually the same pointer passed to it, and it doesn't really reduce much code, so change it back to void. Assigning rettv->vval.v_string = NULL is not needed if a pointer is within 64 bits. While this is usually the case, I'm not sure if it can be taken for granted. --- src/nvim/eval.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 5c85d764fb..eedc8ac45d 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -262,7 +262,7 @@ return { nextnonblank={args=1, base=1}, nr2char={args={1, 2}, base=1}, ['or']={args=2, base=1}, - pathshorten={args=1, base=1}, + pathshorten={args={1, 2}, base=1}, pow={args=2, base=1}, prevnonblank={args=1, base=1}, printf={args=varargs(1), base=2}, -- cgit From fba00b5e7ef2b6903a4588a2c080d8b33a8a2b68 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 1 Jan 2022 14:58:32 +0000 Subject: vim-patch:8.2.1665: cannot do fuzzy string matching Problem: Cannot do fuzzy string matching. Solution: Add matchfuzzy(). (Yegappan Lakshmanan, closes vim/vim#6932) https://github.com/vim/vim/commit/635414dd2f3ae7d4d972d79b806348a6516cb91a Adjust Test_matchfuzzy's 2nd assert to expect the last error thrown, as v8.2.1183 hasn't been ported yet (to be honest, the error message is kinda weird if the 2nd argument is not convertible to string). We can still port this fully as porting v8.2.1183 would require removing this change to pass CI. --- src/nvim/eval.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index eedc8ac45d..37b051222e 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -249,6 +249,7 @@ return { matcharg={args=1, base=1}, matchdelete={args={1, 2}, base=1}, matchend={args={2, 4}, base=1}, + matchfuzzy={args=2, base=1}, matchlist={args={2, 4}, base=1}, matchstr={args={2, 4}, base=1}, matchstrpos={args={2,4}, base=1}, -- cgit From 960ea01972ad5fd291a846dce67f96a95222c310 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 1 Jan 2022 16:40:28 +0000 Subject: vim-patch:8.2.1726: fuzzy matching only works on strings Problem: Fuzzy matching only works on strings. Solution: Support passing a dict. Add matchfuzzypos() to also get the match positions. (Yegappan Lakshmanan, closes vim/vim#6947) https://github.com/vim/vim/commit/4f73b8e9cc83f647b34002554a8bdf9abec0a82f Also remove some N/A and seemingly useless NULL checks -- Nvim allocs can't return NULL. I'm not sure why the retmatchpos stuff in match_fuzzy checks for NULL too, given that Vim checks for NULL alloc in do_fuzzymatch; assert that the li stuff is not NULL as that's the one check I'm ever-so-slightly unsure about. Adjust tests. Note that the text_cb tests actually throw E6000 in Nvim, but we also can't assert that error due to v8.2.1183 not being ported yet. --- src/nvim/eval.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 37b051222e..6dedd0f745 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -249,7 +249,8 @@ return { matcharg={args=1, base=1}, matchdelete={args={1, 2}, base=1}, matchend={args={2, 4}, base=1}, - matchfuzzy={args=2, base=1}, + matchfuzzy={args={2, 3}, base=1}, + matchfuzzypos={args={2, 3}, base=1}, matchlist={args={2, 4}, base=1}, matchstr={args={2, 4}, base=1}, matchstrpos={args={2,4}, base=1}, -- cgit From cdb2c100118ab788772a6a0a1d60f555370fd201 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 1 Feb 2022 12:44:14 +0000 Subject: vim-patch:8.2.0915: search() cannot skip over matches like searchpair() can Problem: Search() cannot skip over matches like searchpair() can. Solution: Add an optional "skip" argument. (Christian Brabandt, closes vim/vim#861) https://github.com/vim/vim/commit/adc17a5f9d207fd1623fd923457a46efc9214777 Enable skip arg usage in autoload/freebasic.vim evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway: - Port evalarg_T into eval.h and use const char * and Callback fields - Use EVALARG_INIT to initialize - Return bool over OK/FAIL from evalarg functions - Remove check from evalarg_clean as callback_free ignores None callbacks anyway - Move eva_buf field into evalarg_get as a local (not sure what reason it has being in the struct) N/A patches for version.c: vim-patch:8.2.4355: unnecessary call to check_colorcolumn() Problem: Unnecessary call to check_colorcolumn(). Solution: Remove the call. (Sean Dewar, closes vim/vim#9748) https://github.com/vim/vim/commit/0f7ff851cb721bb3c07261adbf82b591229f530d --- src/nvim/eval.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 1e39854c86..05e91a658f 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -307,12 +307,12 @@ return { screenpos={args=3, base=1}, screenrow={}, screenstring={args=2, base=1}, - search={args={1, 4}, base=1}, + search={args={1, 5}, base=1}, searchcount={args={0, 1}, base=1}, searchdecl={args={1, 3}, base=1}, searchpair={args={3, 7}}, searchpairpos={args={3, 7}}, - searchpos={args={1, 4}, base=1}, + searchpos={args={1, 5}, base=1}, serverlist={}, serverstart={args={0, 1}}, serverstop={args=1}, -- cgit From cbc54cf484d1082e8c09b955e86aff4579ad8f8a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 17 Feb 2022 15:23:17 +0800 Subject: vim-patch:8.2.3184: cannot add a digraph with a leading space Problem: Cannot add a digraph with a leading space. It is not easy to list existing digraphs. Solution: Add setdigraph(), setdigraphlist(), getdigraph() and getdigraphlist(). (closes vim/vim#8580) https://github.com/vim/vim/commit/6106504e9edc8500131f7a36e59bc146f90180fa Use GA_APPEND_VIA_PTR in registerdigraph(). Use tv_list_append_*() in getdigraphlist_appendpair(). Put the error messages in digraph.c. E196 is N/A. Remove mentions about 'encoding' being non-Unicode. Nvim doesn't support setting encoding=japan, so skip a test. --- src/nvim/eval.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 05e91a658f..0951cd239d 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -156,6 +156,8 @@ return { getcurpos={args={0, 1}, base=1}, getcursorcharpos={args={0, 1}, base=1}, getcwd={args={0, 2}, base=1}, + getdigraph={args=1, base=1}, + getdigraphlist={args={0, 1}, base=1}, getenv={args=1, base=1}, getfontname={args={0, 1}}, getfperm={args=1, base=1}, @@ -322,6 +324,8 @@ return { setcharsearch={args=1, base=1}, setcmdpos={args=1, base=1}, setcursorcharpos={args={1, 3}, base=1}, + setdigraph={args=2, base=1}, + setdigraphlist={args=1, base=1}, setenv={args=2, base=2}, setfperm={args=2, base=1}, setline={args=2, base=2}, -- cgit From 3b0bcb8ad0816e363cdaa7565f0d9ed0702d1d4e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 17 Feb 2022 18:42:48 +0800 Subject: vim-patch:8.2.3226: new digraph functions use old naming scheme Problem: New digraph functions use old naming scheme. Solution: Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580) https://github.com/vim/vim/commit/29b857150c111a455f1a38a8f748243524f692e1 --- src/nvim/eval.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 0951cd239d..698cffe2fa 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -102,6 +102,10 @@ return { did_filetype={}, diff_filler={args=1, base=1}, diff_hlID={args=2, base=1}, + digraph_get={args=1, base=1}, + digraph_getlist={args={0, 1}, base=1}, + digraph_set={args=2, base=1}, + digraph_setlist={args=1, base=1}, empty={args=1, base=1}, environ={}, escape={args=2, base=1}, @@ -156,8 +160,6 @@ return { getcurpos={args={0, 1}, base=1}, getcursorcharpos={args={0, 1}, base=1}, getcwd={args={0, 2}, base=1}, - getdigraph={args=1, base=1}, - getdigraphlist={args={0, 1}, base=1}, getenv={args=1, base=1}, getfontname={args={0, 1}}, getfperm={args=1, base=1}, @@ -324,8 +326,6 @@ return { setcharsearch={args=1, base=1}, setcmdpos={args=1, base=1}, setcursorcharpos={args={1, 3}, base=1}, - setdigraph={args=2, base=1}, - setdigraphlist={args=1, base=1}, setenv={args=2, base=2}, setfperm={args=2, base=1}, setline={args=2, base=2}, -- cgit From dbdd58e548fcf55848359b696275fd848756db7b Mon Sep 17 00:00:00 2001 From: Shougo Date: Mon, 9 May 2022 13:52:31 +0900 Subject: feat: cmdline funcs (#18284) vim-patch:8.2.4903: cannot get the current cmdline completion type and position Problem: Cannot get the current cmdline completion type and position. Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita, closes vim/vim#10344) https://github.com/vim/vim/commit/79d599b8772022af1d657f368c2fc97aa342c0da vim-patch:8.2.4910: imperfect coding Problem: Imperfect coding. Solution: Make code nicer. https://github.com/vim/vim/commit/9ff7d717aa3176de5c61de340deb93f41c7780fc --- src/nvim/eval.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 698cffe2fa..d7a17d6e15 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -152,8 +152,10 @@ return { getcharpos={args=1, base=1}, getcharsearch={}, getcharstr={args={0, 1}}, + getcmdcompltype={}, getcmdline={}, getcmdpos={}, + getcmdscreenpos={}, getcmdtype={}, getcmdwintype={}, getcompletion={args={2, 3}, base=1}, -- cgit From 5c41165c8e89356bdb7d1b5835d1f79725b62d2c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 29 Apr 2022 17:26:57 +0100 Subject: feat(lua): allow some viml functions to run in fast This change adds the necessary plumbing to annotate functions in funcs.c as being allowed in run in luv fast events. --- src/nvim/eval.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index d7a17d6e15..3db0d27018 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -10,6 +10,7 @@ -- Defaults to BASE_NONE (function cannot be used as a method). -- func Name of the C function which implements the VimL function. Defaults to -- `f_{funcname}`. +-- fast Function can run in |api-fast| events. Defaults to false. local varargs = function(nr) return {nr} @@ -205,7 +206,7 @@ return { hlID={args=1, base=1}, hlexists={args=1, base=1}, hostname={}, - iconv={args=3, base=1}, + iconv={args=3, base=1, fast=true}, indent={args=1, base=1}, index={args={2, 4}, base=1}, input={args={1, 3}, base=1}, -- cgit