aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
Commit message (Collapse)AuthorAge
...
| * vim-patch:8.2.3408: can delete a numbered functionzeertzjq2022-10-27
| | | | | | | | | | | | | | | | | | Problem: Can delete a numbered function. (Naohiro Ono) Solution: Disallow deleting a numbered function. (closes vim/vim#8760) https://github.com/vim/vim/commit/ddfc05100a29263a682dd96bb924dfde4354a654 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.2726: confusing error message with white space before commazeertzjq2022-10-27
| | | | | | | | | | | | | | | | | | | | Problem: Confusing error message with white space before comma in the arguments of a function declaration. Solution: Give a specific error message. (closes vim/vim#2235) https://github.com/vim/vim/commit/86cdb8a4bd1abff40b5f80c3c4149b33cbaab990 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.0610: some tests are still old stylezeertzjq2022-10-26
| | | | | | | | | | | | | | | | | | | | | | Problem: Some tests are still old style. Solution: Convert to new style tests. (Yegappan Lakshmanan, closes vim/vim#5957) https://github.com/vim/vim/commit/08f4157c5cabc55bcb22f04dd7c717aba40caa34 Fix missing error message when sort() compare function fails. Cherry-pick a line in test_utf8.vim from patch 8.2.0448. Cherry-pick builtin_function() change from patch 8.2.0595.
| * vim-patch:8.2.0908: crash when changing the function table while listing itzeertzjq2022-10-24
| | | | | | | | | | | | | | | | | | Problem: Crash when changing the function table while listing it. Solution: Bail out when the function table changes. (closes vim/vim#6209) https://github.com/vim/vim/commit/3fffa97159a427067b60c80ed4645e168cc5c4bd Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
| * refactor: replace char_u with charDundar Göc2022-10-15
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:8.2.2316: Vim9: cannot list a lambda functionzeertzjq2022-10-04
| | | | | | | | | | | | Problem: Vim9: cannot list a lambda function. Solution: Support the <lambda>9 notation, like :disassemble. (closes vim/vim#7634) https://github.com/vim/vim/commit/b657198cb30765468451d7f68fce49b5b4000c5d
| * vim-patch:9.0.0568: autocmd code is indented more than needed (#20318)zeertzjq2022-09-24
| | | | | | | | | | | | Problem: Autocmd code is indented more than needed. Solution: Break out sooner. (Yegappan Lakshmanan, closes vim/vim#11208) Also in user function code. https://github.com/vim/vim/commit/e9dcf13a3007d4f603e007e0526b0005fd026bc5
| * fix(eval)!: make Lua Funcref work as method and in substitute() (#20217)zeertzjq2022-09-16
| | | | | | | | | | | | | | | | | | | | | | | | BREAKING CHANGE: When using a Funcref converted from a Lua function as a method in Vim script, the result of the base expression is now passed as the first argument instead of being ignored. vim-patch:8.2.5117: crash when calling a Lua callback from a :def function Problem: Crash when calling a Lua callback from a :def function. (Bohdan Makohin) Solution: Handle FC_CFUNC in call_user_func_check(). (closes vim/vim#10587) https://github.com/vim/vim/commit/7d149f899d423b7bf2b90d7b11ebe3e560c462b9
| * vim-patch:9.0.0476: varargs does not work for replacement function of ↵zeertzjq2022-09-16
| | | | | | | | | | | | | | substitute() (#20216) Problem: Varargs does not work for replacement function of substitute(). Solution: Check the varargs flag of the function. (closes vim/vim#11142) https://github.com/vim/vim/commit/48db5dafecacced4a9e42de3f92838b2d59beb4c
| * vim-patch:8.2.3796: the funcexe_T struct members are not named consistently ↵zeertzjq2022-09-16
| | | | | | | | | | | | | | | | | | (#20214) Problem: The funcexe_T struct members are not named consistently. Solution: Prefix "fe_" to all the members. https://github.com/vim/vim/commit/851f86b951cdd67ad9cf3149e46169d1375c8d82 Omit fe_check_type: always NULL in legacy Vim script.
| * vim-patch:8.2.0067: ERROR_UNKNOWN clashes on some systems (#20212)zeertzjq2022-09-16
| | | | | | | | | | | | | | Problem: ERROR_UNKNOWN clashes on some systems. Solution: Rename ERROR_ to FCERR_. (Ola Söder, closes vim/vim#5415) https://github.com/vim/vim/commit/ef140544f6703a7a4c0f6a15f610508ed6b09e89 Remove ERROR_BOTH which was removed from Vim in patch 7.4.1582.
| * refactor: replace char_u with charDundar Göc2022-09-11
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-09-10
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-09-09
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor(typval): change FC_CFUNC abstraction into FC_LUAREFbfredl2022-09-07
| | | | | | | | | | | | | | | | | | | | | | | | "cfuncs" was only ever used to wrap luarefs. As vim8script is finished and will not be developed further, support for "cfuncs" for other usecases are not planned. This abstraction was immediately broken anyway in order to get luarefs out of userfuncs again. Even if a new kind of userfunc needs to be invented in the future, likely just extending the FC_... flag union directy, instead of invoking unnecessary heap object and c function pointer indirection, will be a more straightforward design pattern.
| * refactor: replace char_u with charDundar Göc2022-09-06
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: migrate comment style (#20012)Lewis Russell2022-09-02
| | | | | | | | | | | | | | | | | | Done automatically using the following perl command: perl -pi -0777pe 's#\n\K */\*\n(.+?)\s*\*/\n#join("\n", map { $_ =~ s:^\s*\K \*://:; $_ } split("\n", $1)) . "\n"#sge' src/nvim/**/*.c Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * refactor: replace char_u with charDundar Göc2022-09-01
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:8.2.0301: insufficient testing for exception handling (#20016)zeertzjq2022-08-31
| | | | | | | | | | | | | | | | Problem: Insufficient testing for exception handling and the "attention" prompt. Solution: Add test cases. (Yegappan Lakshmanan, closes vim/vim#5681) https://github.com/vim/vim/commit/b654103ad1e379348616f354272db86804ab4bdb Fix memory leak from last char_u refactor.
| * fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
| * refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | | | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-08-29
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: change FALSE/TRUE to false/trueLewis Russell2022-08-26
| | | | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * refactor: pre-incr to post-incrLewis Russell2022-08-25
| |
| * vim-patch:8.2.0522: several errors are not tested for (#19901)zeertzjq2022-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Several errors are not tested for. Solution: Add tests. (Yegappan Lakshmanan, closes vim/vim#5892) https://github.com/vim/vim/commit/ee4e0c1e9a81cb5d96e0060203a9033c2f28588e Omit Test_range() change: reverted in patch 8.2.0615. Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195. Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183. Make uniq() error behavior consistent with sort(). Cherry-pick Test_set_ttytype() change from patch 8.1.1826. Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim. Test_viminfo_error() is applicable. Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
* | eval/userfunc.c: save the repeat_cmdline along with the redo buffJosh Rahm2022-09-15
|/ | | | | | A user function can clobber the repeat_cmdline, which is used to build the redo buffer, thus, if the redo buffer is saved when calling a userfunc, so should the repeat_cmdline.
* refactor: change pre-decrement/increment to post (#19799)Lewis Russell2022-08-16
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:8.2.0823: Vim9: script reload test is disabledzeertzjq2022-08-14
| | | | | | | | | | Problem: Vim9: script reload test is disabled. Solution: Compile a function in the context of the script where it was defined. Set execution stack for compiled function. Add a test that an error is reported for the right file/function. https://github.com/vim/vim/commit/25e0f5863e9010a75a1ff0d04e8f886403968755 Omit stack_top_is_ufunc(): only used by Vim9 script.
* vim-patch:8.2.0078: expanding <sfile> works differently the second timezeertzjq2022-08-14
| | | | | | Problem: Expanding <sfile> works differently the second time. Solution: Keep the expanded name when redefining a function. (closes vim/vim#5425) https://github.com/vim/vim/commit/b9adef79eca6f95bc7376ff3a6a383e436c5d6ea
* vim-patch:8.2.0056: execution stack is incomplete and inefficientzeertzjq2022-08-14
| | | | | | | | | | | Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used. https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Omit test_debugger.vim: superseded by later patches. Omit check_map_keycodes(): N/A. Omit kword_test.c: N/A (converted to a unit test).
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* refactor: replace char_u with charDundar Goc2022-08-12
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)zeertzjq2022-08-12
| | | | This avoids including ex_eval.h in any other header, thus preventing future circular includes.
* vim-patch:8.1.1689: profiling code is spread outzeertzjq2022-08-12
| | | | | | | Problem: Profiling code is spread out. Solution: Move more profiling code to profiler.c. (Yegappan Lakshmanan, closes vim/vim#4668) https://github.com/vim/vim/commit/660a10ad41c14363326f83451c3c425201923119
* vim-patch:8.1.1684: profiling functionality is spread outzeertzjq2022-08-12
| | | | | | | | | Problem: Profiling functionality is spread out. Solution: Put profiling functionality in profiling.c. (Yegappan Lakshmanan, closes vim/vim#4666) https://github.com/vim/vim/commit/fa55cfc69d2b14761e2a8bd85bc1e0d82df770aa Move proftime_T to types.h for now to avoid recursive #include.
* refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq2022-08-11
| | | | | | | vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
* vim-patch:8.2.1281: the "trailing characters" error can be hard to understandzeertzjq2022-08-07
| | | | | | Problem: The "trailing characters" error can be hard to understand. Solution: Add the trailing characters to the message. https://github.com/vim/vim/commit/2d06bfde29bd3a62fc85823d2aa719ef943bd319
* refactor: fix clang and PVS warnings (#19569)zeertzjq2022-07-29
| | | | The last commit didn't actually disable V1028 because of a typo. Fix the typo so it is actually disabled.
* refactor: move FunPtr to types.h (#19466)zeertzjq2022-07-22
| | | | | This type itself is not eval-specific. Moving it to types.h can avoid including eval/funcs.h in many headers, and types.h is already included by many headers.
* vim-patch:8.1.1933: the eval.c file is too big (#19462)zeertzjq2022-07-22
| | | | | | | | Problem: The eval.c file is too big. Solution: Move code related to variables to evalvars.c. (Yegappan Lakshmanan, closes vim/vim#4868) https://github.com/vim/vim/commit/0522ba0359c96a8c2a4fc8fca0d3b58e49dda759 Name the new file eval/vars.c instead.
* vim-patch:8.1.1076: file for Insert mode is much too bigzeertzjq2022-07-20
| | | | | | | | | | | | Problem: File for Insert mode is much too big. Solution: Split off the code for Insert completion. (Yegappan Lakshmanan, closes vim/vim#4044) https://github.com/vim/vim/commit/7591bb39d58ece38a5fef984a08ea9012616c1f9 Cherry-pick ins_compl_len() -> get_compl_len() from patch 8.2.4001. Revert a71c5e9eb98fbb2ca88510269935cdcda37369fc: ctrl_x_mode is no longer a global variable, so l_ctrl_x_mode is no longer needed.
* refactor: replace char_uDundar Goc2022-07-02
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* ci(coverity): annotate register_cfunc as leaking memoryJames McCoy2022-05-20
| | | | | | | | | | register_cfunc allocates a ufunc_T, but doesn't store the pointer anywhere before returning. The uf_name member variable is stored in a hashtable and used to lookup the ufunc_T later, but that's too much for Coverity to track. Adding the annotation ensures that any new callers to register_cfunc don't pop up as new "leaks" in the Coverity scans.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-11
| | | | Work on https://github.com/neovim/neovim/issues/459