diff src/eval.c @ 22606:336ac63fb987 v8.2.1851

patch 8.2.1851: Vim9: "!" followed by space incorrectly used Commit: https://github.com/vim/vim/commit/27491cd3ef86c10a2b64bcb657f29e1d0fccb183 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 15 21:54:56 2020 +0200 patch 8.2.1851: Vim9: "!" followed by space incorrectly used Problem: Vim9: "!" followed by space incorrectly used. Solution: Skip over trailing spaces. (closes https://github.com/vim/vim/issues/7131)
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Oct 2020 22:00:04 +0200
parents eb54d34ecd27
children 5cbcd3768125
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -3390,10 +3390,14 @@ eval7_leader(
 	f = rettv->vval.v_float;
     else
 #endif
+    {
+	while (VIM_ISWHITE(end_leader[-1]))
+	    --end_leader;
 	if (in_vim9script() && end_leader[-1] == '!')
 	    val = tv2bool(rettv);
 	else
 	    val = tv_get_number_chk(rettv, &error);
+    }
     if (error)
     {
 	clear_tv(rettv);