Skip to content

Commit ed8b099

Browse files
committed
patch 8.2.3318: Vim9: cannot ignore quotes in number at the command line
Problem: Vim9: cannot ignore quotes in number at the command line. Solution: Use in_vim9script() so that after ":vim9" quotes are ignored.
1 parent 33ea9fd commit ed8b099

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/testdir/test_float_func.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ def Test_float_quotes()
261261
call assert_fails("echo string(123'456.7'89)", 'E116:')
262262
enddef
263263

264+
func Test_float_quotes_from_legacy()
265+
call assert_equal("\n123456.789", execute("vim9 echo 12'34'56.789"))
266+
endfunc
267+
264268
func Test_float2nr()
265269
call assert_equal(1, float2nr(1.234))
266270
call assert_equal(123, float2nr(1.234e2))

src/typval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ eval_number(
17041704
int want_string UNUSED)
17051705
{
17061706
int len;
1707-
int skip_quotes = current_sctx.sc_version >= 4;
1707+
int skip_quotes = current_sctx.sc_version >= 4 || in_vim9script();
17081708
#ifdef FEAT_FLOAT
17091709
char_u *p;
17101710
int get_float = FALSE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3318,
758760
/**/
759761
3317,
760762
/**/

0 commit comments

Comments
 (0)