Problem: Inconsistent naming of get_list_tv() and eval_dict().
Solution: Rename get_list_tv() to eval_list(). Similarly for eval_number(),
eval_string(), eval_lit_string() and a few others.
9a78e6df17
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No falsy Coalescing operator.
Solution: Add the "??" operator. Fix mistake with function argument count.
92f26c256e
Cherry-pick tv2bool() into eval/typval.c.
Cherry-pick *??* tag from Vim runtime.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
feat(lua)!: add stricter vim.tbl_islist(), rename vim.tbl_isarray()
Problem: `vim.tbl_islist` allows gaps in tables with integer keys
("arrays").
Solution: Rename `vim.tbl_islist` to `vim.tbl_isarray`, add new
`vim.tbl.islist` that checks for consecutive integer keys that start
from 1.
Problem: Vim9: line continuation in lambda doesn't always work.
Solution: Do not use a local evalarg unless there isn't one. (closesvim/vim#6439)
8af81d656a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat(lua): vim.tbl_contains supports general tables and predicates
Problem: `vim.tbl_contains` only works for list-like tables (integer
keys without gaps) and primitive values (in particular, not for nested
tables).
Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new
`vim.tbl_contains` that works for general tables and optionally allows
`value` to be a predicate function that is checked for every key.
Problem: Vim9: crash when using variable in a loop at script level.
Solution: Do not clear the variable if a function was defined.
Do not create a new entry in sn_var_vals every time.
(closesvim/vim#8628)
2eb6fc3b52
Omit eval_cstack: Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: double quote can be a string or a comment.
Solution: Only support comments starting with # to avoid confusion.
962d721319
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: line continuation does not work in function arguments.
Solution: Pass "evalarg" to get_func_tv(). Fix seeing double quoted string
as comment.
e6b5324e3a
Omit skipwhite_and_linebreak_keep_string(): Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: cannot use line break in :execute, :echomsg and :echoerr
argument.
Solution: Check for line break.
47e880d6c1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed in a for loop.
Solution: Skip line breaks in for command.
b7a78f7a67
Omit *_break_count and skip_for_lines(): Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed in a while loop.
Solution: Update stored loop lines when finding line breaks.
d5053d015a
Omit getline_peek(): Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed after some operators.
Solution: Skip a line break after the operator. Add
eval_may_get_next_line() to simplify checking for a line break.
9215f01218
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed inside a lambda.
Solution: Handle line break inside a lambda in Vim9 script.
e40fbc2ca9
Omit skip_expr_concatenate(). Apply the change to skip_expr() instead.
Omit eval_ga: Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: fail to check for white space in list.
Solution: Add check for white space.
e6e031739c
N/A patches for version.c:
vim-patch:8.2.1070: Vim9: leaking memory when lacking white space in dict
Problem: Vim9: leaking memory when lacking white space in dict.
Solution: Clear the typval.
ab19d495fd
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed inside a dict.
Solution: Handle line break inside a dict in Vim9 script.
8ea9390b78
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed inside a list.
Solution: Handle line break inside a list in Vim9 script.
7147820cb9
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed before comperators.
Solution: Check for comperator after line break.
e6536aa766
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed before || or &&.
Solution: Check for operator after line break.
be7ee48876
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed inside "cond ? val1 : val2".
Solution: Check for operator after line break.
793648fb56
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: leaking memory when using continuation line.
Solution: Keep a pointer to the continuation line in evalarg_T. Centralize
checking for a next command.
b171fb1790
Omit eval_next_line(): Vim9 script only.
vim-patch:8.2.1050: missing change in struct
Problem: Missing change in struct.
Solution: Add missing change.
65a8ed37f7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: script cannot use line continuation like in a :def function.
Solution: Pass the getline function pointer to the eval() functions. Use it
for addition and multiplication operators.
5409f5d8c9
Omit source_nextline() and eval_next_non_blank(): Vim9 script only.
N/A patches for version.c:
vim-patch:8.2.1048: build failure without the eval feature
Problem: Build failure without the eval feature.
Solution: Add dummy typedef.
9d40c63c7d
vim-patch:8.2.1052: build failure with older compilers
Problem: Build failure with older compilers.
Solution: Move declaration to start of block.
7acde51832
Co-authored-by: Bram Moolenaar <Bram@vim.org>
vim-patch:8.2.0695: Vim9: cannot define a function inside a function
Problem: Vim9: cannot define a function inside a function.
Solution: Initial support for :def inside :def.
04b1269783
vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script
Problem: Vim9: cannot call a function declared later in Vim9 script.
Solution: Make two passes through the script file.
09689a0284
vim-patch:8.2.0734: Vim9: leaking memory when using :finish
Problem: Vim9: leaking memory when using :finish.
Solution: Do not check for next line in third pass.
04816717df
vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase
Problem: Vim9: expressions are evaluated in the discovery phase.
Solution: Bail out if an expression is not a constant. Require a type for
declared constants.
32e351179e
vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well
Problem: Vim9: using a discovery phase doesn't work well.
Solution: Remove the discovery phase, instead compile a function only when
it is used. Add :defcompile to compile def functions earlier.
822ba24743
vim-patch:8.2.0819: compiler warning for unused variable
Problem: Compiler warning for unused variable.
Solution: Remove the variable.
f40e51a880
vim-patch:8.2.0822: Vim9: code left over from discovery phase
Problem: Vim9: code left over from discovery phase.
Solution: Remove the dead code.
2eec37926d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Unnecessary redrawing when 'showcmdloc' is not "last".
Solution: Redraw later when "showcmd_is_clear" is set. (Luuk van Baal,
closesvim/vim#12260)
aa7f25ebf1