Commit: patch 9.0.2160: instanceof() should use varargs as second arg

2023-12-12 Fir de Conversatie Christian Brabandt
patch 9.0.2160: instanceof() should use varargs as second arg

Commit: 
https://github.com/vim/vim/commit/2025af165ec68d831f0f0f668a3ceac3f39142ef
Author: Ernie Rael 
Date:   Tue Dec 12 16:58:00 2023 +0100

patch 9.0.2160: instanceof() should use varargs as second arg

Problem:  instanceof() should use varargs as second arg
Solution: Modify `instanceof()` to use varargs instead of list

Modify `instanceof()` to use varargs instead of list
Valid `instanceof()` arguments are `type`s. A `type` is not a value;
it cannot be added to a list.

This change is non-compatible with the current usage of instanceof;
but instanceof is relatively new and it's a trivial change.

fixes: #13421
closes: #13644

Signed-off-by: Ernie Rael 
Signed-off-by: Christian Brabandt 

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index a4a097847..c9b9938dd 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -5058,12 +5058,12 @@ insert({object}, {item} [, {idx}])  
*insert()*
*instanceof()* *E614* *E616* *E693*
 instanceof({object}, {class})
The result is a Number, which is |TRUE| when the {object}
-   argument is a direct or indirect instance of a |Class|
-   specified by {class}.
-   When {class} is a |List| the function returns |TRUE| when
+   argument is a direct or indirect instance of a |Class|,
+   |Interface|, or class |:type| alias specified by {class}.
+   If {class} is varargs, the function returns |TRUE| when
{object} is an instance of any of the specified classes.
Example: >
-   instanceof(animal, [Dog, Cat])
+   instanceof(animal, Dog, Cat)
 
 <  Can also be used as a |method|: >
myobj->instanceof(mytype)
diff --git a/src/errors.h b/src/errors.h
index 2788800c0..7192514f0 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -1778,8 +1778,8 @@ EXTERN char e_can_only_compare_list_with_list[]
INIT(= N_("E691: Can only compare List with List"));
 EXTERN char e_invalid_operation_for_list[]
INIT(= N_("E692: Invalid operation for List"));
-EXTERN char e_list_or_class_required_for_argument_nr[]
-   INIT(= N_("E693: List or Class required for argument %d"));
+EXTERN char e_class_or_typealias_required_for_argument_nr[]
+   INIT(= N_("E693: Class or class typealias required for argument %d"));
 EXTERN char e_invalid_operation_for_funcrefs[]
INIT(= N_("E694: Invalid operation for Funcrefs"));
 EXTERN char e_cannot_index_a_funcref[]
@@ -3562,13 +3562,13 @@ EXTERN char e_using_typealias_as_value_str[]
 EXTERN char e_abstract_cannot_be_used_in_interface[]
INIT(= N_("E1404: Abstract cannot be used in an interface"));
 EXTERN char e_using_class_as_value_str[]
-   INIT(= N_("E1403: Class \"%s\" cannot be used as a value"));
+   INIT(= N_("E1405: Class \"%s\" cannot be used as a value"));
 EXTERN char e_using_class_as_var_val[]
-   INIT(= N_("E1405: Cannot use a Class as a variable or value"));
+   INIT(= N_("E1406: Cannot use a Class as a variable or value"));
 EXTERN char e_using_typealias_as_var_val[]
-   INIT(= N_("E1406: Cannot use a Typealias as a variable or value"));
+   INIT(= N_("E1407: Cannot use a Typealias as a variable or value"));
 #endif
-// E1405 - E1499 unused (reserved for Vim9 class support)
+// E1408 - E1499 unused (reserved for Vim9 class support)
 EXTERN char e_cannot_mix_positional_and_non_positional_str[]
INIT(= N_("E1500: Cannot mix positional and non-positional arguments: 
%s"));
 EXTERN char e_fmt_arg_nr_unused_str[]
diff --git a/src/evalfunc.c b/src/evalfunc.c
index b0b975061..84d0a338a 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -758,17 +758,23 @@ arg_string_or_func(type_T *type, type_T *decl_type 
UNUSED, argcontext_T *context
 }
 
 /*
- * Check "type" is a list of 'any' or a class.
+ * Check varargs' "type" are class.
  */
 static int
-arg_class_or_list(type_T *type, type_T *decl_type UNUSED, argcontext_T 
*context)
+varargs_class(type_T *type UNUSED,
+ type_T *decl_type UNUSED,
+ argcontext_T *context)
 {
-if (type->tt_type == VAR_CLASS
-   || type->tt_type == VAR_LIST
-   || type_any_or_unknown(type))
-   return OK;
-arg_type_mismatch(_class, type, context->arg_idx + 1);
-return FAIL;
+for (int i = context->arg_idx; i < context->arg_count; ++i)
+{
+   type2_T *types = >arg_types[i];
+   if (types->type_curr->tt_type != VAR_CLASS)
+   {
+   semsg(_(e_class_or_typealias_required_for_argument_nr), i + 1);
+   return FAIL;
+   }
+}
+return OK;
 }
 
 /*
@@ -1152,7 +1158,7 @@ static argcheck_T arg1_len[] = {arg_len1};
 static argcheck_T arg3_libcall[] = {arg_string, arg_string, 

Commit: CI: bump actions/labeler from 4 to 5 (#13658)

2023-12-12 Fir de Conversatie Christian Brabandt
CI: bump actions/labeler from 4 to 5 (#13658)

Commit: 
https://github.com/vim/vim/commit/c1c3b83816c8e22c9a710fb0c0cebc180ee6ce1e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Dec 12 16:51:32 2023 +0100

CI: bump actions/labeler from 4 to 5 
(https://github.com/vim/vim/issues/13658)

Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v4...v5)

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Christian Brabandt 

diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml
index e4ed94869..afed05eb4 100644
--- a/.github/workflows/label.yml
+++ b/.github/workflows/label.yml
@@ -17,7 +17,7 @@ jobs:
   pull-requests: write
 
 steps:
-- uses: actions/labeler@v4
+- uses: actions/labeler@v5
   with:
 repo-token: "${{ secrets.GITHUB_TOKEN }}"
 configuration-path: .github/labeler.yml

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rD5B5-00G9xP-QK%40256bit.org.


Commit: runtime(vim): Update syntax file, fix missing for highlight (#13668)

2023-12-12 Fir de Conversatie Christian Brabandt
runtime(vim): Update syntax file, fix missing for highlight (#13668)

Commit: 
https://github.com/vim/vim/commit/1c97b5c0c0b4a60d652b78da4470aeb8a7509700
Author: dkearns 
Date:   Wed Dec 13 02:47:43 2023 +1100

runtime(vim): Update syntax file, fix missing for highlight 
(https://github.com/vim/vim/issues/13668)

Fix highlighting of :for command.  Link the vimFor syntax group to the
vimCommand highlight group.

Error introduced in commit f686921

Signed-off-by: Doug Kearns 
Signed-off-by: Christian Brabandt 

diff --git a/runtime/syntax/testdir/dumps/vim_variables_07.dump 
b/runtime/syntax/testdir/dumps/vim_variables_07.dump
index 8be0fa802..f0288f0ad 100644
--- a/runtime/syntax/testdir/dumps/vim_variables_07.dump
+++ b/runtime/syntax/testdir/dumps/vim_variables_07.dump
@@ -10,10 +10,10 @@
 @75
 |"+0#e05&| |:|f|o|r| +0#000&@68
 @75
-|f|o|r| |f+0#00e0e07&|o@1| +0#000&|i+0#af5f00255&|n| +0#000&|e|x|p|r| 
@59
+|f+0#af5f00255&|o|r| +0#000&|f+0#00e0e07&|o@1| 
+0#000&|i+0#af5f00255&|n| +0#000&|e|x|p|r| @59
 |e+0#af5f00255&|n|d|f|o|r| +0#000&@68
 @75
-|f|o|r| |[|f+0#00e0e07&|o@1|,+0#000&| |b+0#00e0e07&|a|r|]+0#000&| 
|i+0#af5f00255&|n| +0#000&|e|x|p|r| @52
+|f+0#af5f00255&|o|r| +0#000&|[|f+0#00e0e07&|o@1|,+0#000&| 
|b+0#00e0e07&|a|r|]+0#000&| |i+0#af5f00255&|n| +0#000&|e|x|p|r| @52
 |e+0#af5f00255&|n|d|f|o|r| +0#000&@68
 |~+0#4040ff13&| @73
 |~| @73
diff --git a/runtime/syntax/testdir/dumps/vim_variables_99.dump 
b/runtime/syntax/testdir/dumps/vim_variables_99.dump
index 6f3e1c444..003603ec3 100644
--- a/runtime/syntax/testdir/dumps/vim_variables_99.dump
+++ b/runtime/syntax/testdir/dumps/vim_variables_99.dump
@@ -12,9 +12,9 @@
 @75
 |"+0#e05&| |:|f|o|r| +0#000&@68
 @75
-|f|o|r| |f+0#00e0e07&|o@1| +0#000&|i+0#af5f00255&|n| +0#000&|e|x|p|r| 
@59
+|f+0#af5f00255&|o|r| +0#000&|f+0#00e0e07&|o@1| 
+0#000&|i+0#af5f00255&|n| +0#000&|e|x|p|r| @59
 |e+0#af5f00255&|n|d|f|o|r| +0#000&@68
 @75
-|f|o|r| |[|f+0#00e0e07&|o@1|,+0#000&| |b+0#00e0e07&|a|r|]+0#000&| 
|i+0#af5f00255&|n| +0#000&|e|x|p|r| @52
+|f+0#af5f00255&|o|r| +0#000&|[|f+0#00e0e07&|o@1|,+0#000&| 
|b+0#00e0e07&|a|r|]+0#000&| |i+0#af5f00255&|n| +0#000&|e|x|p|r| @52
 >e+0#af5f00255&|n|d|f|o|r| +0#000&@68
 @57|1|3|8|,|1| @8|B|o|t| 
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 5697ce3f6..c1706e0f1 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -938,6 +938,7 @@ if !exists("skip_vim_syntax_inits")
  hi def link vimFuncEcho   vimCommand
  hi def link vimHiCtermul  vimHiTerm
  hi def link vimFold   Folded
+ hi def link vimForvimCommand
  hi def link vimFTCmd  vimCommand
  hi def link vimFTOption   vimSynType
  hi def link vimFuncKeyvimCommand

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rD5B5-00G9wz-3v%40256bit.org.


Commit: patch 9.0.2159: screenpos() may crash with neg. column

2023-12-12 Fir de Conversatie Christian Brabandt
patch 9.0.2159: screenpos() may crash with neg. column

Commit: 
https://github.com/vim/vim/commit/ec54af4e26952d954a4cc009f62c80ea01445d30
Author: zeertzjq 
Date:   Tue Dec 12 16:43:44 2023 +0100

patch 9.0.2159: screenpos() may crash with neg. column

Problem:  screenpos() may crash with neg. column
Solution: validate and correct column

closes: #13669

Signed-off-by: zeertzjq 
Signed-off-by: Christian Brabandt 

diff --git a/src/move.c b/src/move.c
index fbb352a32..861d84b84 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1531,6 +1531,8 @@ f_screenpos(typval_T *argvars UNUSED, typval_T *rettv)
return;
 }
 pos.col = tv_get_number([2]) - 1;
+if (pos.col < 0)
+   pos.col = 0;
 pos.coladd = 0;
 textpos2screenpos(wp, , , , , );
 
diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim
index 3cdf4cb7f..2bdda869e 100644
--- a/src/testdir/test_cursor_func.vim
+++ b/src/testdir/test_cursor_func.vim
@@ -206,6 +206,11 @@ func Test_screenpos()
   nmenu WinBar.TEST :
   call assert_equal(#{col: 1, row: 2, endcol: 1, curscol: 1}, 
screenpos(win_getid(), 1, 1))
   nunmenu WinBar.TEST
+  call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, 
screenpos(win_getid(), 1, 1))
+
+  call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, 0, 
1))
+  call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, -1, 
1))
+  call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(0, 1, 
-v:maxcol))
 endfunc
 
 func Test_screenpos_fold()
diff --git a/src/version.c b/src/version.c
index 4bb1c90ba..15ff51dd7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+2159,
 /**/
 2158,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rD5B3-00G9wO-Mo%40256bit.org.


Re: Missing tags (again) on Mercurial

2023-12-12 Fir de Conversatie Tony Mechelynck
On Tue, Dec 12, 2023 at 8:41 AM Christian Brabandt  wrote:
>
>
> On Di, 12 Dez 2023, Tony Mechelynck wrote:
>
> > Something has gone wrong again.
> >
> > Remember: tags v9.0.2140 to v9.0.2142 had gone missing, but tags
> > v9.0.2143 to v9.0.2155 had been set correctly. Well, now tags
> > v9.0.2156 to v9.0.2158 have gone missing again.
> >
> > This concerns only the Mercurial .hgtags metadata (and I don't know
> > about any git metadata). In all cases the src/version.c contains the
> > full list of patch numbers.
>
> Fixed. Not sure why this happened, the script did not receive a tag when
> processing the git revision. This could happen, if I push out a new
> patch, then the hg-bridge runs and a few moments later the tag is
> pushed. However, this shouldn't happen 3 times in a row, so it's a bit
> mysterious.

IOW, a race condition between the git commit and the hg fetch (or
whatever it is called). Let's hope your fix catches it in the future.
I'll keep eyes peeled in any case.
>
> I added some extra logic to parse the subject line in addition when this
> happens again.
>
> Thanks,
> Christian

My pleasure,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJkCKXu0Hz8SaRH5TGWjmkNVdVy4P%3DVrcoegwb9ZVkcJFy6O4g%40mail.gmail.com.