Commit Graph

25636 Commits

Author SHA1 Message Date
zeertzjq
ef9af89da7 vim-patch:8.2.4930: interpolated string expression requires escaping
Problem:    Interpolated string expression requires escaping.
Solution:   Do not require escaping in the expression.

0abc2871c1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 18:19:17 +08:00
zeertzjq
bacb5021d4 vim-patch:8.2.4883: string interpolation only works in heredoc
Problem:    String interpolation only works in heredoc.
Solution:   Support interpolated strings.  Use syntax for heredoc consistent
            with strings, similar to C#. (closes vim/vim#10327)

2eaef106e4

Cherry-pick Test_Debugger_breakadd_expr() from Vim.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-15 17:59:32 +08:00
zeertzjq
2cf8f01e7d vim-patch:8.2.4840: heredoc expression evaluated even when skipping
Problem:    Heredoc expression evaluated even when skipping.
Solution:   Don't evaluate when "skip" is set. (closes vim/vim#10306)

05c7f5d3d0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:40:31 +08:00
zeertzjq
3c16e75ae1 vim-patch:8.2.4783: Coverity warns for leaking memory
Problem:    Coverity warns for leaking memory.
Solution:   Use another strategy freeing "theline".

42ccb8d747

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:40:31 +08:00
zeertzjq
3ad8c08acc vim-patch:8.2.4770: cannot easily mix expression and heredoc
Problem:    Cannot easily mix expression and heredoc.
Solution:   Support  in heredoc. (Yegappan Lakshmanan, closes vim/vim#10138)

efbfa867a1

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 17:40:31 +08:00
zeertzjq
071c455420
Merge pull request #23102 from zeertzjq/vim-8.2.1378
vim-patch:8.2.{1378,3856,4361,4373,4476}
2023-04-15 17:38:46 +08:00
zeertzjq
1b556c04bf vim-patch:8.2.4476: operator name spelled wrong
Problem:    Operator name spelled wrong.
Solution:   Change trinary to ternary. (Goc Dundar, closes vim/vim#9850)

e41c1dd889

Co-authored-by: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
2023-04-15 17:15:04 +08:00
zeertzjq
408e5d16a9 vim-patch:8.2.4373: expression test fails
Problem:    Expression test fails.
Solution:   Make the test work with latest Vim9 syntax.

c87aa34dfd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:14:49 +08:00
zeertzjq
b29df57ba7 vim-patch:8.2.4361: Vim9: some tests fail
Problem:    Vim9: some tests fail.
Solution:   Fix the tests, mostly by removing "s:".

62b191c387

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:14:30 +08:00
zeertzjq
f04125a935 vim-patch:8.2.3856: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Run more expression tests also with Vim9. Fix an uncovered
            problem.

fea43e44c0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:09:42 +08:00
zeertzjq
700152fbf8 vim-patch:8.2.1378: cannot put space between function name and paren
Problem:    Cannot put space between function name and paren.
Solution:   Allow this for backwards compatibility.

bbd3e3c357

This fixes a regression from patch 8.2.1365, which isn't ported yet.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:09:41 +08:00
zeertzjq
0a61cb60a6
Merge pull request #23099 from zeertzjq/vim-8.2.1014
vim-patch:8.2.{1014,3329}
2023-04-15 14:57:14 +08:00
zeertzjq
9636ae6a13 vim-patch:8.2.3329: v_lock not set when getting value of environment variable
Problem:    v_lock not set when getting value of environment variable.
Solution:   Set v_lock to zero.

16e63e6d35

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 14:28:40 +08:00
zeertzjq
031cf60d4a vim-patch:8.2.1014: using "name" for a string result is confusing
Problem:    Using "name" for a string result is confusing.
Solution:   Rename to "end".

1e0b7b11db

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 14:21:07 +08:00
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