aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
| * vim-patch:8.1.1803: all builtin functions are globalSean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: All builtin functions are global. Solution: Add the method call operator ->. Implemented for a limited number of functions. https://github.com/vim/vim/commit/ac92e25a33c37ec5becbfffeccda136c73b761ac - Note that to *exactly* port hunk @@ -7376,18 +7444,19 from handle_subscript(), we need the :scriptversion patches (I have an open PR for those, but this patch works fine without them anyway). - Port call_internal_func() from v7.4.2058. - Adjust some error messages in tests, as they rely on the Blob patches. - Add a modeline to test_method.vim. Ignore the global_functions and base_method tables and prefer the current GPerf implementation. Instead, add an extra base_arg field to VimLFuncDef that holds the number of the argument to use as the base (1-indexed, so that 0 may be used to refer to functions that cannot be used as methods). This also means we support using any argument as a base from the get-go, rather than just the first (Vim includes this ability in future patches, however). To mark a function as usable as a method, use the "base" key as described in eval.lua.
| * vim-patch:8.1.1800: function call functions have too many argumentsSean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | Problem: Function call functions have too many arguments. Solution: Pass values in a funcexe_T struct. https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a Use FUNCEXE_INIT to initialize funcexe_T instances. call_callback() and other Vim listener related stuff is N/A.
| * fix(eval): cherry-pick emsg changes from v8.1.0736Sean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | | | v8.1.0736 made some changes for making some emsgs more specific. Includes the change for Test_lambda_fails() in test_lambda.vim. Adjust relevant functionaltests to expect the new emsgs. This patch has been fully ported in my Blob port PR, but it hasn't been merged yet, so just use what we need from it for now. Required for v8.1.1821.
* | refactor(map): remove extra-allocating map_new/map_free functionsBjörn Linse2021-08-22
| | | | | | | | | | | | | | | | | | | | Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls.
* | perf(map): reduce double pointer indirection to single pointer indirectionBjörn Linse2021-08-22
|/ | | | | the only field of Map(...) was a pointer to a khash_t. make it contain the struct by value instead.
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)Jan Edmund Lazo2021-06-26
| | | | | | Problem: Can modify a:000 when using a reference. Solution: Make check for locked variable stricter. (Ozaki Kiichi, closes vim/vim#3930) https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788
* vim-patch:8.2.1255: cannot use a lambda with quickfix functionsJan Edmund Lazo2021-06-23
| | | | | | Problem: Cannot use a lambda with quickfix functions. Solution: Add support for lambda. (Yegappan Lakshmanan, closes vim/vim#6499) https://github.com/vim/vim/commit/d43906d2e5969288f239df851f5ad7b1dc2c7251
* vim-patch:8.1.1437: code to handle callbacks is duplicatedJan Edmund Lazo2021-06-23
| | | | | | | | | | | | | Problem: Code to handle callbacks is duplicated. Solution: Add callback_T and functions to deal with it. https://github.com/vim/vim/commit/3a97bb3f0f8bd118ae23f1c97e55d84ff42eef20 Port Vim's put_callback() as callback_put() because Neovim's naming convention is {type}_{action}, not {action}_{type}. Renaming put_callback type as PutCallback. https://neovim.io/develop/style-guide.xml#Type_Names
* clang/API: reject null string in timer_start()Jan Edmund Lazo2021-06-02
|
* Merge remote-tracking branch 'origin/master' into qftfkevinhwang912021-05-20
|\
| * Remove '- 1' for sizes passed to xstrlcpyJan Edmund Lazo2021-05-19
| | | | | | | | | | | | | | | | xstrlcpy() NUL-terminates the destination string such that reducing the destination string length by 1 to reserve the last byte for NUL is pointless. https://github.com/neovim/neovim/pull/14490#discussion_r635661185
* | vim-patch:8.2.0869: it is not possible to customize the quickfix window contentskevinhwang912021-05-20
|/ | | | | | Problem: It is not possible to customize the quickfix window contents. Solution: Add 'quickfixtextfunc'. (Yegappan Lakshmanan, closes vim/vim#5465) https://github.com/vim/vim/commit/858ba06d5f577b187da0367b231f7fa9461cb32d
* vim-patch:8.0.1394: cannot intercept a yank commandJan Edmund Lazo2021-05-13
| | | | | | | Problem: Cannot intercept a yank command. Solution: Add the TextYankPost autocommand event. (Philippe Vaucher et al., closes vim/vim#2333) https://github.com/vim/vim/commit/7e1652c63c96585b9e2235c195a3c322b1f11595
* vim-patch:8.1.1967: line() only works for the current windowJan Edmund Lazo2021-05-12
| | | | | | Problem: Line() only works for the current window. Solution: Add an optional argument for the window to use. https://github.com/vim/vim/commit/8e0a8e7eb7c177807f44db6b76d8e52314248ab5
* Merge pull request #14403 from seandewar/vim-8.2.1933Jan Edmund Lazo2021-05-09
|\ | | | | vim-patch:8.2.{0174,1933,1935,1946,2286,2287}
| * eval: port v:collateSean Dewar2021-04-20
| | | | | | | | Cherry-picked from patch v8.2.0988. Required for patch v8.2.1933.
* | vim-patch:d1caa941d876Jan Edmund Lazo2021-04-27
| | | | | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/d1caa941d876181aae0ebebc6ea954045bf0da24 Cherry-pick error E452 from patch v8.2.0486.
* | vim-patch:8.2.2388: no easy way to get the maximum or mininum number valueJan Edmund Lazo2021-04-27
| | | | | | | | | | | | Problem: No easy way to get the maximum or mininum number value. Solution: Add v:numbermax and v:numbermin. https://github.com/vim/vim/commit/57d5a01cb45d6edb16c3835a49b42d6d8fc0163e
* | vim-patch:8.2.0296: mixing up "long long" and __int64 may cause problemsJan Edmund Lazo2021-04-27
|/ | | | | | | Problem: Mixing up "long long" and __int64 may cause problems. (John Marriott) Solution: Pass varnumber_T to vim_snprintf(). Add v:numbersize. https://github.com/vim/vim/commit/f9706e9df0e37d214fb08eda30ba29627e97a607
* vim-patch:8.2.2319: "exptype_T" can be read as "expected type"Jan Edmund Lazo2021-04-11
| | | | | | | | Problem: "exptype_T" can be read as "expected type". Solution: Rename to "exprtype_T", expression type. https://github.com/vim/vim/commit/657137ca487c60d63989236115115161def270a5 Vim9 changes omitted.
* vim-patch:8.2.0069: ETYPE_ is used for two different enumsJan Edmund Lazo2021-04-11
| | | | | | Problem: ETYPE_ is used for two different enums. Solution: Rename one to use EXPR_. https://github.com/vim/vim/commit/87396072c5c468f0c129e4ec7cd944ac897b7752
* vim-patch:8.2.0045: script test failsJan Edmund Lazo2021-04-11
| | | | | | Problem: Script test fails. Solution: For numbers "is" and "isnot" work like "==" and "!=". https://github.com/vim/vim/commit/ec57ec692eb228ee061824a190d7c451f029c430
* vim-patch:8.2.0044: expression type is used inconsistentlyJan Edmund Lazo2021-04-11
| | | | | | | Problem: Expression type is used inconsistently. Solution: Add "ETYPE_IS" and "ETYPE_ISNOT" as separate enum values. Rename "TYPE_" to "ETYPE_" to avoid confusion. https://github.com/vim/vim/commit/07a3db89b8953bd0964895badb3b662f7514bc10
* eval: add v:_null_stringJan Edmund Lazo2021-04-08
| | | | | | | | | | Replacement for Vim's test_null_string(). Vim uses it to verify that its codebase handles null strings. Preparation for the Test_null_list() in patch v8.2.1822. Use v:_null_string, not non-existent env var, for null string tests. Mention v:_null_string in id() because id(v:_null_string) returns (nil).
* vim-patch:8.0.1511: some code for the debugger watch expression is clumsyJan Edmund Lazo2021-04-08
| | | | | | Problem: Some code for the debugger watch expression is clumsy. Solution: Clean up the code. https://github.com/vim/vim/commit/3198870137df64214317151726648af8e56f1729
* vim-patch:8.0.1505: debugger can't break on a conditionJan Edmund Lazo2021-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Debugger can't break on a condition. (Charles Campbell) Solution: Add ":breakadd expr". (Christian Brabandt, closes vim/vim#859) https://github.com/vim/vim/commit/c6f9f739d32084923c3031cbf6f581f8c8bf7fd2 Do not port "has_watchexpr()" to avoid dead code. "has_watchexpr()" always returns 0 because "debug_expr" is always 0. Restore "eval_expr()" as a wrapper to allocate "typval_T" for "eval0()". Remove it in later patches. Include "typval_compare()" changes from patch v8.1.0958, partially ported in 8b60368c1b9e23f0695557da170d416d71f7e6a3. Close https://github.com/neovim/neovim/pull/12373 N/A patches for version.c: vim-patch:8.2.2720: GTK menu tooltip moves the cursor Problem: GTK menu tooltip moves the cursor. Solution: Position the cursor after displaying the tooltip. Do not show the tooltip when editing the command line. https://github.com/vim/vim/commit/01ac0a1f664c5b1ffd5c9ef196d4b47edf2fd494
* luaref: simplify handling of table callables and fix leak in vim.fn.call(table)Björn Linse2021-04-03
| | | | I AM THE TABLE
* vim-patch:8.2.2694: when 'matchpairs' is empty every character beeps (#14279)Jan Edmund Lazo2021-04-03
| | | | | | Problem: When 'matchpairs' is empty every character beeps. (Marco Hinz) Solution: Bail out when no character in 'matchpairs' was found. (closes vim/vim#8053) Add assert_nobeep(). https://github.com/vim/vim/commit/5b8cabfef7c3707f3e53e13844d90e5a217e1e84
* Change QUEUE_FOREACH macro to use while instead of forerw72021-03-30
|
* vim-patch:8.1.0958: compiling weird regexp pattern is very slowJan Edmund Lazo2021-03-29
| | | | | | | | | | Problem: Compiling weird regexp pattern is very slow. Solution: When reallocating post list increase size by 50%. (Kuang-che Wu, closes vim/vim#4012) Make assert_inrange() accept float values. https://github.com/vim/vim/commit/38f08e76acf7d21bb34cf8f79f0f82eb63cdc987 Omit changes to typval_compare() because patch v8.0.1505 was not ported.
* floats: add borders (MS-DOS MODE)Björn Linse2021-03-22
|
* vim-patch:8.2.2341: expresison command line completion incomplete after "g:"Jan Edmund Lazo2021-03-12
| | | | | | | | | | Problem: Expresison command line completion shows variables but not functions after "g:". (Gary Johnson) Solution: Prefix "g:" when needed to a global function. https://github.com/vim/vim/commit/1bb4de5302ba038b9c59e845b6d735e87d5681d0 Port most of patch v8.2.0335 to complete script-local functions if the name starts with "s:".
* vim-patch:8.2.1507: using malloc() directlyJan Edmund Lazo2021-03-09
| | | | | | | Problem: Using malloc() directly. Solution: Use ALLOC_ONE(). Remove superfluous typecast. (Hussam al-Homsi, closes vim/vim#6768) https://github.com/vim/vim/commit/51b6eb47b3c41b01a5559b099e65354c8897093e
* vim-patch:8.2.2070: can't get the exit value in VimLeave(Pre) autocommands ↵Jan Edmund Lazo2021-02-20
| | | | | | | | | | | | | | | | | (#13981) Problem: Can't get the exit value in VimLeave or VimLeavePre autocommands. Solution: Add v:exiting like in Neovim. (Yegappan Lakshmanan, closes vim/vim#7395) https://github.com/vim/vim/commit/f0068c5154a99b86b2c4515a4b93c003b2445cf4 Rearrange VimVarIndex enums and vimvars[] entries to sync with Vim. N/A patches for version.c: vim-patch:8.2.2535: MS-Windows: cannot run all vim9 tests Problem: MS-Windows: cannot run all vim9 tests. Solution: Make test_vim9 target work. https://github.com/vim/vim/commit/723ef5db980b2e69ef8bdc0dd448cb645491c464
* option: use char* for get_option_value() paramJan Edmund Lazo2021-02-07
| | | | | | 'name' param is casted to char_u* within get_option_value(). Most calls to get_option_value() cast arg to 'name' from char to char_u. Remove these pointless type casts.
* eval: use char* for set_var_lval() paramJan Edmund Lazo2021-02-07
| | | | | | 'op' param is casted to char_u* within set_val_lval(). Most calls to set_val_lval() cast arg to 'op' from char to char_u. Remove these pointless type casts.
* eval: use char* for set_internal_string_var()Jan Edmund Lazo2021-02-07
| | | | | | "name" param was cast to (const char *). All calls to set_internal_string_var() cast from (char *) to (char_u *). Remove these useless casts.
* eval: ll_range,ll_empty2 members are boolJan Edmund Lazo2021-02-06
|
* Use abort() instead of assert(false) for things that should never happenJames McCoy2021-01-31
| | | | | | | | assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
* vim-patch:8.1.1261: no error for quickfix commands with negative rangeerw72021-01-01
| | | | | | | | | | | | | | | Problem: No error for quickfix commands with negative range. Solution: Add ADDR_UNSIGNED and use it for quickfix commands. Make assert_fails() show the command if the error doesn't match. https://github.com/vim/vim/commit/25190db225d63e185e77e043e694ef455b3cf304 N/A patches for version.c: vim-patch:8.2.0113: "make cmdidxs" fails Problem: "make cmdidxs" fails. Solution: Allow address for ":cquit". Add --not-a-term to avoid a delay. https://github.com/vim/vim/commit/9b24dfcb9f676e7f7a09a9062f0d05b2104a87eb
* vim-patch:8.1.1727: code for viminfo support is spread outJan Edmund Lazo2020-12-30
| | | | | | | | | | | | | | | | | | | | | Problem: Code for viminfo support is spread out. Solution: Move to code to viminfo.c. (Yegappan Lakshmanan, closes vim/vim#4686) https://github.com/vim/vim/commit/defa067c54874dd987121dd7252c62755e0aebfa N/A patches for version.c: vim-patch:8.1.1230: a lot of code is shared between vim.exe and gvim.exe Problem: A lot of code is shared between vim.exe and gvim.exe. Solution: Optionally put the shared code in vim.dll. (Ken Takata, closes vim/vim#4287) https://github.com/vim/vim/commit/afde13b62b8fa25dac4635d5caee8d088b937ee0 vim-patch:8.2.2247: VMS: various smaller problems Problem: VMS: various smaller problems. Solution: Fix VMS building and other problems. (Zoltan Arpadffy) https://github.com/vim/vim/commit/467676d468cb10db78d79d5bd2139ded9f70d26f
* vim-patch:8.2.0928: many type casts are used for vim_strnsave()Jan Edmund Lazo2020-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes vim/vim#5633) Remove some type casts. https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff N/A patches for version.c: vim-patch:8.2.0315: build failure on HP-UX system Problem: Build failure on HP-UX system. Solution: Use LONG_LONG_MIN instead of LLONG_MIN. Add type casts for switch statement. (John Marriott) https://github.com/vim/vim/commit/c593bec4120f122e8a9129ec461968f1bd214435 vim-patch:8.2.1052: build failure with older compilers Problem: Build failure with older compilers. Solution: Move declaration to start of block. https://github.com/vim/vim/commit/7acde51832f383f9a6d2e740cd0420b433ea841a vim-patch:8.2.2229: build failure without the +eval feature Problem: build failure without the +eval feature. Solution: Add #ifdef. https://github.com/vim/vim/commit/39cb2dab18e85fc60f116a4543e433616872b690 vim-patch:8.2.2232: compiler error for falling through into next case Problem: Compiler error for falling through into next case. Solution: Move FALLTHROUGH below the #endif https://github.com/vim/vim/commit/9618a25b9c054f0ee4e267d2db96b6e7c113ed7a
* vim-patch:8.2.2206: :exe command line completion only works for first argumentJan Edmund Lazo2020-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: :exe command line completion only works for first argument. Solution: Skip over text if more is following. (closes vim/vim#7546) https://github.com/vim/vim/commit/4941b5effd7f6a26583a949c92ee50276a3b43f9 Port "IS_WHITE_OR_NUL" macro from patch v8.2.0562 as "ascii_iswhite_or_nul()" inline function. N/A patches for version.c: vim-patch:8.2.0782: cannot build with Lua on MS-Windows Problem: Cannot build with Lua on MS-Windows. Solution: Add DLL symbol for luaL_Loadstring. (Ken Takata) https://github.com/vim/vim/commit/df1643a6a7886b9363c2a98438e61cbe1c803d41 vim-patch:8.2.0856: CTRL-S stops output Problem: CTRL-S stops output. Solution: Invert the IXON flag. (closes vim/vim#6166) https://github.com/vim/vim/commit/928eec649b8af389de0fdb7aba2034d27df3e058 vim-patch:8.2.1212: cannot build with Lua 5.4 Problem: Cannot build with Lua 5.4. Solution: Use luaL_typeerror instead defining it. (closes vim/vim#6454) https://github.com/vim/vim/commit/5551b131daef3a621a28dcbbe118920f5b9fabe6 vim-patch:8.2.2211: MS-Windows: can't load Python dll if not in the path Problem: MS-Windows: can't load Python dll if not in the path. Solution: Use the InstallPath registry entry. (Kelvin Lee, closes vim/vim#7540) https://github.com/vim/vim/commit/b2f9e0e2c537bcde16dab3b62687a17e17849ce1
* refactor: de-curwin-ify update_topline/curs_columnsMatthieu Coudron2020-12-23
|
* fix: Include auto/config.h before HAVE_* preprocessor checksJames McCoy2020-12-15
| | | | Closes #13533
* vim-patch:8.2.0602: :unlet $VAR does not work properly (#13238)Sean Dewar2020-12-02
| | | | | | | Problem: :unlet $VAR does not work properly. Solution: Make ":lockvar $VAR" fail. Check the "skip" flag. https://github.com/vim/vim/commit/7e0868efcf094f2cc59fa4e18af3a8dc7aedd64f Include patch 8.2.0601 changes so that ex_unletlock() can execute a callback if there are no errors.
* refactor: pass window to was_set_insecurelyMatthieu Coudron2020-11-23
| | | | | | working on get_foldtext and wanted to get rid of the curwin backup/restore. Turns out it's not possible else f_foldtext is run on the same window. Kept the cleanup anyway.
* eval: use VAR_UNLOCKED enum, not the direct valueJan Edmund Lazo2020-11-21
|
* vim-patch:8.2.2028: Coverity warns for using an uninitialized variableJan Edmund Lazo2020-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity warns for using an uninitialized variable. Solution: Initialize to NULL. https://github.com/vim/vim/commit/896ad2c33e562e4b674b7e0efbd43be85a64acc8 N/A patches for version.c: vim-patch:8.1.1749: Coverity warns for using negative index Problem: Coverity warns for using negative index. Solution: Move using index inside "if". https://github.com/vim/vim/commit/736cd2cfbe83b85259eecc7d70e68297ce968d33 vim-patch:8.2.0579: Coverity warns for unused value Problem: Coverity warns for unused value. Solution: Change order and use "else if". https://github.com/vim/vim/commit/4d5d0dfe9438bd5f2daa41ebbe6ac9a76d165af0 vim-patch:8.2.2025: Amiga: Not all colors are used on OS4 Problem: Amiga: Not all colors are used on OS4. Solution: Adjust the #ifdef to include __amigaos4__. (Ola Söder, closes vim/vim#7328) https://github.com/vim/vim/commit/2d718267f4b7dcd65261c9f2acd59a6f6bdc8641