summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-08 19:56:28 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-08 19:56:28 +0200
commited8b099fd23b20d7b5a436182bde6672c8686189 (patch)
tree8132d1ffe0c2e2801a3bbcc27518ffe9445b9693
parent33ea9fd4d849324f1e958cc669987a51cf0baded (diff)
downloadvim-git-ed8b099fd23b20d7b5a436182bde6672c8686189.tar.gz
patch 8.2.3318: Vim9: cannot ignore quotes in number at the command linev8.2.3318
Problem: Vim9: cannot ignore quotes in number at the command line. Solution: Use in_vim9script() so that after ":vim9" quotes are ignored.
-rw-r--r--src/testdir/test_float_func.vim4
-rw-r--r--src/typval.c2
-rw-r--r--src/version.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/testdir/test_float_func.vim b/src/testdir/test_float_func.vim
index 628bbb0c0..77687d1fc 100644
--- a/src/testdir/test_float_func.vim
+++ b/src/testdir/test_float_func.vim
@@ -261,6 +261,10 @@ def Test_float_quotes()
call assert_fails("echo string(123'456.7'89)", 'E116:')
enddef
+func Test_float_quotes_from_legacy()
+ call assert_equal("\n123456.789", execute("vim9 echo 12'34'56.789"))
+endfunc
+
func Test_float2nr()
call assert_equal(1, float2nr(1.234))
call assert_equal(123, float2nr(1.234e2))
diff --git a/src/typval.c b/src/typval.c
index 389ca3427..5a62fa069 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -1704,7 +1704,7 @@ eval_number(
int want_string UNUSED)
{
int len;
- int skip_quotes = current_sctx.sc_version >= 4;
+ int skip_quotes = current_sctx.sc_version >= 4 || in_vim9script();
#ifdef FEAT_FLOAT
char_u *p;
int get_float = FALSE;
diff --git a/src/version.c b/src/version.c
index aacefc03d..8971e5dd8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3318,
+/**/
3317,
/**/
3316,