aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
* 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
* menu: remove winbar codeJan Edmund Lazo2020-11-20
| | | | | | | | | No unmerged Vim patch, applicable to Neovim, depend on WinBar feature. It was merged only for merging Vim patches. It is currently useless in Neovim. Remove it to avoid rendering issues. Close https://github.com/neovim/neovim/issues/12689
* Removed restricted mode - Fix #11972georg3tom2020-11-11
|
* vim-patch:8.2.1901: variable completion does not work in command line windowJan Edmund Lazo2020-10-25
| | | | | | | | | | | | | | Problem: Variable completion does not work in command line window. Solution: Use the "prevwin". (closes vim/vim#7198) https://github.com/vim/vim/commit/4ff2f2fb6bef01a06bd726bae8dfa8dd6355d594 N/A patches for version.c: vim-patch:8.2.1899: crash in out-of-memory situation Problem: Crash in out-of-memory situation. Solution: Bail out if shell_name is NULL. (Dominique Pellé, closes vim/vim#7196) https://github.com/vim/vim/commit/67def64a4e4590a5f3b55ebfc33c42a3dcd7b559
* vim-patch:8.1.1705: using ~{} for a literal dict is not niceJan Edmund Lazo2020-10-07
| | | | | | Problem: Using ~{} for a literal dict is not nice. Solution: Use #{} instead. https://github.com/vim/vim/commit/4c6d90458baae843463f930fdc3fe4a7a2191d27
* vim-patch:8.1.1692: using *{} for literal dict is not backwards compatibleJan Edmund Lazo2020-10-07
| | | | | | | Problem: Using *{} for literal dict is not backwards compatible. (Yasuhiro Matsumoto) Solution: Use ~{} instead. https://github.com/vim/vim/commit/b8be54dcc517c9d57b62409945b7d4b90b6c3071
* vim-patch:8.1.1686: "*" of "*{" is recognized as multipy operatorJan Edmund Lazo2020-10-07
| | | | | | Problem: "*" of "*{" is recognized as multipy operator. (Yasuhiro Matsumoto) Solution: Check for the "{". https://github.com/vim/vim/commit/2898ebb44cee62a70a11b44a97bdad8cc00157b1
* vim-patch:8.1.1683: dictionary with string keys is longer than neededJan Edmund Lazo2020-10-07
| | | | | | | | | | Problem: Dictionary with string keys is longer than needed. Solution: Use *{key: val} for literaly keys. https://github.com/vim/vim/commit/d5abb4c87727eecb71b0e8ffdda60fc9598272f3 Vim's popup,textprop features are N/A. Neovim has not polyfilled their APIs. Skip docs and tests for these features.
* vim-patch:8.1.1319: computing function length name in many placesJan Edmund Lazo2020-09-30
| | | | | | | | | | | Problem: Computing function length name in many places. Solution: compute name length in call_func(). https://github.com/vim/vim/commit/6ed8819822994512c160006bd1204aa11ae3c494 In call_func(), reassign "len" param to (int)STRLEN(funcname) instead of using vim_strsave() which runs strlen(). "len" param is checked for v:lua functions. call_func() states that strlen() is used if "len" is set to -1.
* vim-patch:8.2.0824: still not enough memory allocated when converting stringJan Edmund Lazo2020-09-19
| | | | | | | Problem: Still not enough memory allocated when converting string with special character. Solution: Reserve space for expanding K_SPECIAL. (closes vim/vim#6130) https://github.com/vim/vim/commit/1919371b2b9ddb1a645f40b59adbd89317530882
* vim-patch:8.2.0817: not enough memory allocated when converting stringJan Edmund Lazo2020-09-19
| | | | | | | | | Problem: Not enough memory allocated when converting string with special character. Solution: Reserve space for modifier code. (closes vim/vim#6130) https://github.com/vim/vim/commit/f7271e831614d15d173c7f562cc26f48c2554ce9 Cherry-pick Test_eval(), Test_nr2char() from patch 8.2.0448.
* buf_attach: fix buffer updates with setline()Björn Linse2020-09-16
|
* win/env: fix stdpath()/XDG_* initialization, parsing #12829erw72020-09-07
| | | | | | | | - Windows environment variables are semicolon-separated, but some logic was assuming colon (:). This broke initialization and parsing of XDG_CONFIG_DIRS, XDG_DATA_DIRS, 'runtimepath', stdpath(), etc. - test/defaults_spec: enable tests on Windows ref #12793
* eval_call_provider(): free unused return value #12819Jacques Germishuys2020-09-01
| | | Caller can pass discard=true to free the unwanted return value.
* vim-patch:8.2.0607: gcc warns for using uninitialized variableJan Edmund Lazo2020-08-19
| | | | | | Problem: Gcc warns for using uninitialized variable. (John Marriott) Solution: Set name_end also for environment variables. https://github.com/vim/vim/commit/2bb76accc66d17f2c027c04396082c46f410bfea
* vim-patch:8.2.1471: :const only locks the variable, not the value (#12765)Jan Edmund Lazo2020-08-16
| | | | | Problem: :const only locks the variable, not the value. Solution: Lock the value as ":lockvar 1 var" would do. (closes vim/vim#6719) https://github.com/vim/vim/commit/241572794f7e93d2f8b762de2300e5f7e4f07628
* vim-patch:8.2.1379: curly braces expression ending in " }" does not workJan Edmund Lazo2020-08-14
| | | | | | Problem: Curly braces expression ending in " }" does not work. Solution: Skip over white space when checking for "}". (closes vim/vim#6634) https://github.com/vim/vim/commit/ae95a3946b012d4e68bcb20b28f691f6d3b9caaf
* vim-patch:8.2.1361: error for white space after expression in assignmentJan Edmund Lazo2020-08-14
| | | | | | Problem: Error for white space after expression in assignment. Solution: Skip over white space. (closes vim/vim#6617) https://github.com/vim/vim/commit/6a25026262e2cdbbd8738361c5bd6ebef8862d87
* vim-patch:8.2.1360: stray error for white space after expressionJan Edmund Lazo2020-08-14
| | | | | | Problem: Stray error for white space after expression. Solution: Ignore trailing white space. (closes vim/vim#6608) https://github.com/vim/vim/commit/f96e9dec636d7d105b015680d8c5d6b47d936e01
* eval: improve ex_execute (#12445)erw72020-07-20
|
* vim-patch:8.2.0899: assert_equalfile() does not give a hint about the differenceJan Edmund Lazo2020-07-19
| | | | | | Problem: Assert_equalfile() does not give a hint about the difference. Solution: Display the last seen text. https://github.com/vim/vim/commit/30cc44a97f0ba1349e1a522dab22b11f47888183
* vim-patch:8.2.0893: assert_equalfile() does not take a third argumentJan Edmund Lazo2020-07-19
| | | | | | Problem: Assert_equalfile() does not take a third argument. Solution: Implement the third argument. (Gary Johnson) https://github.com/vim/vim/commit/fb517bac2384798bb5142ed1f75f965f93984c0a
* vim-patch:8.1.0819: a failed assert with a long string is hard to readJan Edmund Lazo2020-07-19
| | | | | | Problem: A failed assert with a long string is hard to read. Solution: Shorten the assert message. https://github.com/vim/vim/commit/865767126e97d9ac65e052a657b29bbc32dcb512
* lua: Add ability to pass tables with __callTJ DeVries2020-07-10
| | | | | | | | | | | | vim-patch:8.2.1054: not so easy to pass a lua function to Vim vim-patch:8.2.1084: Lua: registering function has useless code I think I have also opened up the possibility for people to use these callbacks elsewhere, since I've added a new struct that we should be able to use. Also, this should allow us to determine what the state of a list is in Lua or a dictionary in Lua, since we now can track the luaref as we go.
* vim-patch:8.1.1372: when evaluating 'statusline' the current window is unknownJan Edmund Lazo2020-07-04
| | | | | | | | Problem: When evaluating 'statusline' the current window is unknown. (Daniel Hahler) Solution: Set "g:actual_curwin" for %{} items. Set "g:statusline_winid" when evaluationg %!. (closes vim/vim#4406, closes vim/vim#3299) https://github.com/vim/vim/commit/1c6fd1e100fd0457375642ec50d483bcc0f61bb2