1
0
forked from aniani/vim

45 Commits

Author SHA1 Message Date
Ernie Rael
e79e207760
patch 9.1.0027: Vim is missing a foreach() func
Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: #12166

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-13 11:47:33 +01:00
zeertzjq
ad0c442f1f
patch 9.0.1723: Fix regression in {func} argument of reduce()
Problem: Fix regression in {func} argument of reduce()
Solution: pass function name as string again

Before patch 9.0.0548, passing a string as {func} argument of reduce()
is treated as a function name, but after patch 9.0.0548 it is treated as
an expression instead, which is useless as reduce() doesn't set any v:
variables. This PR restores the behavior of {func} before that patch.

Also correct an emsg() call, as e_string_list_or_blob_required doesn't
contain format specifiers.

closes: #12824

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:15:47 +02:00
zeertzjq
e7d49465a4 patch 9.0.1459: typo in name of type
Problem:    Typo in name of type.
Solution:   Change funccal_T to funccall_T. (closes #12265)
2023-04-16 20:53:55 +01:00
Ernie Rael
e6d40dcdc7 patch 9.0.1416: crash when collection is modified when using filter()
Problem:    Crash when collection is modified when using filter().
Solution:   Lock the list/dict/blob. (Ernie Rael, closes #12183)
2023-03-19 21:23:38 +00:00
dundargoc
c57b5bcd22 patch 9.0.0828: various typos
Problem:    Various typos.
Solution:   Correct typos. (closes #11432)
2022-11-02 13:30:51 +00:00
Bram Moolenaar
5b2a3d77d3 patch 9.0.0810: readblob() returns empty when trying to read too much
Problem:    readblob() returns empty when trying to read too much.
Solution:   Return what is available.
2022-10-21 11:25:30 +01:00
K.Takata
43625762a9 patch 9.0.0803: readblob() cannot read from character device
Problem:    readblob() cannot read from character device.
Solution:   Use S_ISCHR() to not check the size. (Ken Takata, closes #11407)
2022-10-20 13:28:51 +01:00
K.Takata
11df3aeee5 patch 9.0.0795: readblob() always reads the whole file
Problem:    readblob() always reads the whole file.
Solution:   Add arguments to read part of the file. (Ken Takata,
            closes #11402)
2022-10-19 14:02:40 +01:00
Bram Moolenaar
82418263fa patch 9.0.0618: calling function for reduce() has too much overhead
Problem:    Calling function for reduce() has too much overhead.
Solution:   Do not create a funccall_T every time.
2022-09-28 16:16:15 +01:00
Yegappan Lakshmanan
368aa69088 patch 9.0.0601: too much indent
Problem:    Too much indent.
Solution:   Return out early from a funtion. (Yegappan Lakshmanan,
            close #11238)
2022-09-27 11:46:48 +01:00
Bram Moolenaar
f1c60d4bf1 patch 9.0.0548: reduce() with a compiled lambda could be faster
Problem:    reduce() with a compiled lambda could be faster.
Solution:   Call eval_expr_typval() instead of call_func() directly.
2022-09-22 17:07:00 +01:00
Yegappan Lakshmanan
8deb2b30c7 patch 9.0.0359: error message for wrong argument type is not specific
Problem:    Error message for wrong argument type is not specific.
Solution:   Include more information in the error. (Yegappan Lakshmanan,
            closes #11037)
2022-09-02 15:15:27 +01:00
Yegappan Lakshmanan
72bb47e38f patch 8.2.4670: memory allocation failures for new tab page not tested
Problem:    Memory allocation failures for new tab page not tested.
Solution:   Add tests with failing memory allocation. (Yegappan Lakshmanan,
            closes #10067)
2022-04-03 11:22:38 +01:00
=?UTF-8?q?Dundar=20G=C3=B6c?=
420fabcd4f patch 8.2.4241: some type casts are redundant
Problem:    Some type casts are redundant.
Solution:   Remove the type casts. (closes #9643)
2022-01-28 15:28:04 +00:00
Bram Moolenaar
460ae5dfca patch 8.2.3967: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more errors to errors.h.
2022-01-01 14:19:49 +00:00
Bram Moolenaar
436b5adc97 patch 8.2.3961: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more errors to errors.h.
2021-12-31 22:49:24 +00:00
Bram Moolenaar
f1474d801b patch 8.2.3960: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more errors to errors.h.
2021-12-31 19:59:55 +00:00
Yegappan Lakshmanan
f973eeb491 patch 8.2.3871: list.c contains code for dict and blob
Problem:    List.c contains code for dict and blob.
Solution:   Refactor to put code where it belongs. (Yegappan Lakshmanan,
            closes #9386)
2021-12-22 18:19:26 +00:00
Yegappan Lakshmanan
bc404bfb32 patch 8.2.3855: illegal memory access when displaying a blob
Problem:    Illegal memory access when displaying a blob.
Solution:   Append a NUL at the end. (Yegappan Lakshmanan, closes #9372)
2021-12-19 19:19:31 +00:00
Bram Moolenaar
40bcec1bac patch 8.2.3750: error messages are everywhere
Problem:    Error messages are everywhere.
Solution:   Move more error messages to errors.h and adjust the names.
2021-12-05 22:19:27 +00:00
kuuote
04b7b4bf7f patch 8.2.3728: internal error when passing range() to list2blob()
Problem:    Internal error when passing range() to list2blob().
Solution:   Materialize the list first. (closes #9262)
2021-12-03 13:57:00 +00:00
Yegappan Lakshmanan
5dfe467432 patch 8.2.3438: cannot manipulate blobs
Problem:    Cannot manipulate blobs.
Solution:   Add blob2list() and list2blob(). (Yegappan Lakshmanan,
            closes #8868)
2021-09-14 17:54:30 +02:00
Sean Dewar
80d7395dcf patch 8.2.3284: no error for insert() or remove() changing a locked blob
Problem:    No error for insert() or remove() changing a locked blob.
Solution:   Check a blob is not locked before changing it. (Sean Dewar,
            closes #8696)
2021-08-04 19:25:54 +02:00
Yegappan Lakshmanan
0ad871dc4d patch 8.2.3206: Vim9: argument types are not checked at compile time
Problem:    Vim9: argument types are not checked at compile time.
Solution:   Add several more type checks. (Yegappan Lakshmanan, closes #8611)
2021-07-23 20:37:56 +02:00
Yegappan Lakshmanan
83494b4ac6 patch 8.2.3188: Vim9: argument types are not checked at compile time
Problem:    Vim9: argument types are not checked at compile time.
Solution:   Add several more type checks, also at runtime. (Yegappan
            Lakshmanan, closes #8587)
2021-07-20 17:51:51 +02:00
Bram Moolenaar
f7e92aae15 patch 8.2.2779: memory access error in remove() for blob
Problem:    Memory access error in remove() for blob.
Solution:   Adjust length for memmove().
2021-04-17 21:22:49 +02:00
Bram Moolenaar
51e933261b patch 8.2.2777: Vim9: blob operations not tested in all ways
Problem:    Vim9: blob operations not tested in all ways.
Solution:   Run tests with CheckLegacyAndVim9Success().  Make blob assign with
            index work.
2021-04-17 20:44:56 +02:00
Bram Moolenaar
bd6406f15d patch 8.2.2767: compiler warning for unused argument
Problem:    Compiler warning for unused argument.
Solution:   Remove the argument.
2021-04-14 21:30:06 +02:00
Bram Moolenaar
0e3ff19196 patch 8.2.2765: Vim9: not all blob operations work
Problem:    Vim9: not all blob operations work.
Solution:   Run more tests also with Vim9 script and :def functions.  Fix what
            doesn't work.
2021-04-14 20:35:23 +02:00
Bram Moolenaar
68452177ca patch 8.2.2757: Vim9: blob tests for legacy and Vim9 script are separate
Problem:    Vim9: blob tests for legacy and Vim9 script are separate.
Solution:   Add CheckLegacyAndVim9Success().  Make blob index assign work.
2021-04-12 21:21:02 +02:00
Bram Moolenaar
cfc3023cb6 patch 8.2.2756: Vim9: blob index and slice not implemented yet
Problem:    Vim9: blob index and slice not implemented yet.
Solution:   Implement blob index and slice.
2021-04-11 20:26:34 +02:00
Bram Moolenaar
66fa5fd54f patch 8.2.1866: Vim9: appending to pushed blob gives wrong result
Problem:    Vim9: appending to pushed blob gives wrong result.
Solution:   Set ga_maxlen when copying a blob.
2020-10-19 20:21:03 +02:00
Bram Moolenaar
8a7d6542b3 patch 8.2.0149: maintaining a Vim9 branch separately is more work
Problem:    Maintaining a Vim9 branch separately is more work.
Solution:   Merge the Vim9 script changes.
2020-01-26 15:56:19 +01:00
Bram Moolenaar
c667da5185 patch 8.1.2368: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
2019-11-30 20:52:27 +01:00
Bram Moolenaar
9f9fe37f67 patch 8.1.1763: evalfunc.c is still too big
Problem:    Evalfunc.c is still too big.
Solution:   Move dict and list functions to a better place.
2019-07-27 23:12:12 +02:00
Bram Moolenaar
b7b9efbccf patch 8.1.1671: copying a blob may result in it being locked
Problem:    Copying a blob may result in it being locked.
Solution:   Reset v_lock. (Ken Takata, closes #4648)
2019-07-12 20:17:03 +02:00
Bram Moolenaar
c799fe206e patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
Problem:    Alloc() returning "char_u *" causes a lot of type casts.
Solution:   Have it return "void *". (Mike Williams)  Define ALLOC_ONE() to
            check the simple allocations.
2019-05-28 23:08:19 +02:00
Bram Moolenaar
e142a9467a patch 8.1.1022: may use NULL pointer when out of memory
Problem:    May use NULL pointer when out of memory. (Coverity)
Solution:   Check for blob_alloc() returning NULL.
2019-03-19 23:03:27 +01:00
Bram Moolenaar
a5be9b6248 patch 8.1.0802: negative index doesn't work for Blob
Problem:    Negative index doesn't work for Blob.
Solution:   Make it work, add a test. (closes #3856)
2019-01-24 12:31:44 +01:00
Bram Moolenaar
dd29ea1805 patch 8.1.0798: changing a blob while iterating over it works strangely
Problem:    Changing a blob while iterating over it works strangely.
Solution:   Make a copy of the Blob before iterating.
2019-01-23 21:56:21 +01:00
Bram Moolenaar
4131fd5509 patch 8.1.0765: string format of a Blob can't be parsed back
Problem:    String format of a Blob can't be parsed back.
Solution:   Use 0z format.
2019-01-17 16:32:53 +01:00
Bram Moolenaar
f9e3e09fdc patch 8.1.0743: giving error messages is not flexible
Problem:    Giving error messages is not flexible.
Solution:   Add semsg().  Change argument from "char_u *" to "char *", also
            for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
            #3302)  Also make emsg() accept a "char *" argument.  Get rid of
            an enormous number of type casts.
2019-01-13 23:38:42 +01:00
Bram Moolenaar
8c8b8bb56c patch 8.1.0741: viminfo with Blob is not tested
Problem:    Viminfo with Blob is not tested.
Solution:   Extend the viminfo test.  Fix reading a blob.  Fixed storing a
            special variable value.
2019-01-13 17:48:04 +01:00
Bram Moolenaar
c0f5a78c15 patch 8.1.0736: code for Blob not sufficiently tested
Problem:    Code for Blob not sufficiently tested.
Solution:   Add more tests.  Fix uncovered crash.  Add test_null_blob().
2019-01-13 15:16:13 +01:00
Bram Moolenaar
6e5ea8d2a9 patch 8.1.0735: cannot handle binary data
Problem:    Cannot handle binary data.
Solution:   Add the Blob type. (Yasuhiro Matsumoto, closes #3638)
2019-01-12 22:47:31 +01:00