Commit Graph

25472 Commits

Author SHA1 Message Date
zeertzjq
1ca77c222b
Merge pull request #23097 from zeertzjq/vim-8.2.0101
vim-patch:8.2.{0101,0102,0103,0104,0633,0634}: null typval tests
2023-04-15 14:11:10 +08:00
zeertzjq
85741677c8 vim-patch:8.2.0634: crash with null partial and blob
Problem:    Crash with null partial and blob.
Solution:   Check for NULL pointer.  Add more tests. (Yegappan Lakshmanan,
            closes vim/vim#5984)

92b83ccfda

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:48:30 +08:00
zeertzjq
4b49f312a0 vim-patch:8.2.0633: crash when using null partial in filter()
Problem:    Crash when using null partial in filter().
Solution:   Fix crash.  Add more tests. (Yegappan Lakshmanan, closes vim/vim#5976)

9d8d0b5c64

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:31:10 +08:00
zeertzjq
3d80392cab vim-patch:8.2.0104: using channel or job with ":execute" has strange effects
Problem:    Using channel or job with ":execute" has strange effects.
Solution:   Give an error message for Job and Channel.

b662591e50

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:17:20 +08:00
zeertzjq
4c276bbd18 vim-patch:8.2.0103: using null object with execute() has strange effects
Problem:    Using null object with execute() has strange effects.
Solution:   Give an error message ofr Job and Channel.

e2a8f0773e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:15:10 +08:00
zeertzjq
d372eedcfa vim-patch:8.2.0102: messages test fails in small version
Problem:    Messages test fails in small version.
Solution:   Only use test_null_job() when available.

da292b07af

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:10:27 +08:00
zeertzjq
0eddf5ad2f vim-patch:8.2.0101: crash when passing null object to ":echomsg"
Problem:    Crash when passing null object to ":echomsg".
Solution:   Check for NULL pointer. (Yasuhiro Matsumoto, closes vim/vim#5460)

9db2afe46d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:09:05 +08:00
dundargoc
c2e47e7bec
build: don't print installed files locally
It takes a significant amount of time to install neovim, and doubly so
on Windows, due to the sheer amount of files neovim ships with. On CI
this information may be important though, so we enable it if the
CI_ENABLE option is set to ON.
2023-04-14 19:19:49 +02:00
zeertzjq
ae9654dd73
vim-patch:8.2.4055: Vim9: line break in expression causes v:errmsg to be fillec (#23090)
Problem:    Vim9: line break in expression causes v:errmsg to be filled.
            (Yegappan Lakshmanan)
Solution:   Do not give an error when skipping over an expression.

5e6b9882fe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 21:56:13 +08:00
bfredl
002b80cb5d
Merge pull request #22968 from luukvbaal/evalstc
fix(api): update "w_scwidth" in nvim_eval_statusline()
2023-04-14 15:12:48 +02:00
zeertzjq
e36806666f
vim-patch:8.2.2138: Vim9: "exit_cb" causes Vim to exit (#23087)
Problem:    Vim9: "exit_cb" causes Vim to exit.
Solution:   Require white space after a command in Vim9 script. (closes vim/vim#7467)
            Also fix that Vim9 style heredoc was not always recognized.

b5b9480ee9

Omit EX_NONWHITE_OK, E1143, E1144: Vim9 script only.
Cherry-pick test_vimscript.vim changes from patch 8.2.2141.
Cherry-pick E1145 tag from Vim runtime.

N/A patches for version.c:

vim-patch:8.2.2140: build failure with tiny features

Problem:    Build failure with tiny features.
Solution:   Add #ifdef.

2a3cd3af45

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 20:35:46 +08:00
Lewis Russell
789654accd
Merge pull request #22869 from lewis6991/refactor/unitannot
refactor(unit): add type annotations
2023-04-14 13:27:46 +01:00
Lewis Russell
3d29424fb9 refactor(unit): add type annotations 2023-04-14 12:41:57 +01:00
Lewis Russell
5465adcbab fix(lint): use tbl_contains 2023-04-14 12:41:57 +01:00
zeertzjq
90efe85a99
vim-patch:8.2.1111: inconsistent naming of get_list_tv() and eval_dict() (#23086)
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>
2023-04-14 19:28:39 +08:00
zeertzjq
c15939c1f7
Merge pull request #23084 from zeertzjq/vim-8.2.1794
vim-patch:8.2.{1794,1798},9.0.1452
2023-04-14 18:24:44 +08:00
zeertzjq
3be966f725 vim-patch:9.0.1452: code using EVAL_CONSTANT is dead, it is never set
Problem:    Code using EVAL_CONSTANT is dead, it is never set.
Solution:   Remove EVAL_CONSTANT. (closes vim/vim#12252)

b7f6f93475
2023-04-14 18:04:12 +08:00
zeertzjq
f12afd8e16 vim-patch:8.2.1798: Vim9: trinary operator condition is too permissive
Problem:    Vim9: trinary operator condition is too permissive.
Solution:   Use tv_get_bool_chk().

1310660557

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 18:04:12 +08:00
zeertzjq
d6e2804ab4 vim-patch:8.2.1794: no falsy Coalescing operator
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>
2023-04-14 18:04:09 +08:00
NAKAI Tsuyoshi
7caf0eafd8
feat(lua)!: add stricter vim.tbl_islist() and rename old one to vim.tbl_isarray() (#16440)
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.
2023-04-14 12:01:08 +02:00
zeertzjq
33e90f5138
Merge pull request #23083 from zeertzjq/vim-8.2.1189
vim-patch:8.2.{1189,1512}
2023-04-14 17:40:17 +08:00
zeertzjq
aaacfd4a6d vim-patch:8.2.1512: failure after trinary expression fails
Problem:    Failure after trinary expression fails.
Solution:   Restore eval_flags. (Yasuhiro Matsumoto, closes vim/vim#6776)

69e44552c5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 17:21:22 +08:00
zeertzjq
85a7f9dabe vim-patch:8.2.1189: Vim9: line continuation in lambda doesn't always work
Problem:    Vim9: line continuation in lambda doesn't always work.
Solution:   Do not use a local evalarg unless there isn't one. (closes vim/vim#6439)

8af81d656a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 17:21:22 +08:00
Christian Clason
4d04feb662
feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* 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.
2023-04-14 10:39:57 +02:00
zeertzjq
72a327cad2
Merge pull request #23081 from zeertzjq/vim-8.2.1062
vim-patch:8.2.{1062,1063,1064,1065,1068,1069,1070,1071,1073,1074,1075,1076,1079,1080,1098,1099,1100,1125,1161,1162,1163,1203,3216}
2023-04-14 16:33:37 +08:00
zeertzjq
9c66b48316 vim-patch:8.2.3216: Vim9: crash when using variable in a loop at script level
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.
            (closes vim/vim#8628)

2eb6fc3b52

Omit eval_cstack: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
zeertzjq
56cfecdd59 vim-patch:8.2.1203: unused assignments in expression evaluation
Problem:    Unused assignments in expression evaluation.
Solution:   Move declarations and assignments to inner blocks where possible.

3ac9c4701a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
zeertzjq
c804c7df0c vim-patch:8.2.1162: crash when using a lambda
Problem:    Crash when using a lambda.
Solution:   Check for evalarg to be NULL.

efaaaa683b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
zeertzjq
cc7a50a9ae vim-patch:8.2.1161: Vim9: using freed memory
Problem:    Vim9: using freed memory.
Solution:   Put pointer back in evalarg instead of freeing it.

8e2730a315

Omit eval_tofree_lambda: Vim9 script only.

N/A patches for version.c:

vim-patch:8.2.1163: build error

Problem:    Build error.
Solution:   Add missing change to globals.

6e13530ca0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
562840a2a1 vim-patch:8.2.1125: Vim9: double quote can be a string or a comment
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>
2023-04-14 16:10:09 +08:00
zeertzjq
cf37630d1b vim-patch:8.2.1110: Vim9: line continuation does not work in function arguments
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>
2023-04-14 16:10:09 +08:00
zeertzjq
9c65a18753 vim-patch:8.2.1103: Coverity reports an unnecessary NULL check
Problem:    Coverity reports an unnecessary NULL check.
Solution:   Remove the check for NULL.

e707c882b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
04b58cec86 vim-patch:8.2.1100: Vim9: cannot use line break in :execute argument
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>
2023-04-14 16:10:09 +08:00
zeertzjq
78dd6100b1 vim-patch:8.2.1099: Vim9: cannot use line break in :cexpr argument
Problem:    Vim9: cannot use line break in :cexpr argument.
Solution:   Check for line break.

37c8371195

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
ff963d699b vim-patch:8.2.1098: Vim9: cannot use line break in :throw argument
Problem:    Vim9: cannot use line break in :throw argument.
Solution:   Check for line break.

006ad48b8a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
8729c41f44 vim-patch:8.2.1080: Vim9: no line break allowed in a for loop
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>
2023-04-14 16:10:09 +08:00
zeertzjq
4b84b2e2aa vim-patch:8.2.1079: Vim9: no line break allowed in a while loop
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>
2023-04-14 16:10:09 +08:00
zeertzjq
e99f28e57d vim-patch:8.2.1076: Vim9: no line break allowed in :if expression
Problem:    Vim9: no line break allowed in :if expression.
Solution:   Skip linebreak.

faf8626b79

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
64a91f5ea2 vim-patch:8.2.1075: Vim9: no line break allowed in :echo expression
Problem:    Vim9: no line break allowed in :echo expression.
Solution:   Skip linebreak.

7e8967fdcd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
10b8c6481f vim-patch:8.2.1074: Vim9: no line break allowed after some operators
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>
2023-04-14 16:10:09 +08:00
zeertzjq
9c29c07705 vim-patch:8.2.1073: Vim9: no line break allowed in () expression
Problem:    Vim9: no line break allowed in () expression.
Solution:   Skip a line break.

7a4981b936

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
d927128fcc vim-patch:8.2.1071: Vim9: no line break allowed inside a lambda
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>
2023-04-14 16:10:09 +08:00
zeertzjq
89ff05b258 vim-patch:8.2.1069: Vim9: fail to check for white space in list
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>
2023-04-14 16:10:09 +08:00
zeertzjq
4ce20f7229 vim-patch:8.2.1068: Vim9: no line break allowed inside a dict
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>
2023-04-14 16:10:09 +08:00
zeertzjq
2af6bbcfa7 vim-patch:8.2.1065: Vim9: no line break allowed inside a list
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>
2023-04-14 16:10:09 +08:00
zeertzjq
51f99a347d vim-patch:8.2.1064: Vim9: no line break allowed before comperators
Problem:    Vim9: no line break allowed before comperators.
Solution:   Check for comperator after line break.

e6536aa766

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
9781a21133 vim-patch:8.2.1063: Vim9: no line break allowed before || or &&
Problem:    Vim9: no line break allowed before || or &&.
Solution:   Check for operator after line break.

be7ee48876

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
zeertzjq
9ecfb42ec0 vim-patch:8.2.1062: Vim9: no line break allowed inside "cond ? val1 : val2"
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>
2023-04-14 16:10:08 +08:00
zeertzjq
37bb40701d
Merge pull request #23078 from zeertzjq/vim-8.2.1047
vim-patch:8.2.{1047,1048,1049,1050,1052},9.0.1447
2023-04-14 10:58:29 +08:00
zeertzjq
e8c25aac8d vim-patch:9.0.1447: condition is always true
Problem:    Condition is always true.
Solution:   Remove the useless condition. (closes vim/vim#12253)

474891bc89
2023-04-14 10:30:21 +08:00