aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'origin/fix_repeatcmdline' into mix_20240309mix_20240309Josh Rahm2024-03-09
|\
| * Change from char_u to charfix_repeatcmdlineJosh Rahm2023-11-29
| |
| * Merge remote-tracking branch 'upstream/master' into fix_repeatcmdlineJosh Rahm2023-11-29
| |\
| * \ Merge remote-tracking branch 'upstream/master' into fix_repeatcmdlineJosh Rahm2023-01-25
| |\ \
| * | | 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(IWYU): fix headersdundargoc2024-01-11
| | | | | | | | | | | | | | | | | | | | | | | | Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
* | | | refactor: follow style guidedundargoc2023-12-30
| | | |
* | | | refactor: follow style guidedundargoc2023-12-24
| | | |
* | | | refactor: eliminate cyclic includesdundargoc2023-12-20
| | | |
* | | | refactor: use `bool` to represent boolean valuesdundargoc2023-12-19
| | | |
* | | | docs: add style rule regarding initializationdundargoc2023-12-18
| | | | | | | | | | | | | | | | | | | | Specifically, specify that each initialization should be done on a separate line.
* | | | vim-patch:8.1.1583: set_ref_in_list() only sets ref in items (#26418)zeertzjq2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Set_ref_in_list() only sets ref in items. Solution: Rename to set_ref_in_list_items() to avoid confusion. https://github.com/vim/vim/commit/7be3ab25891fec711d8a2d9d242711a9155852b6 Omit set_ref_in_list() and set_ref_in_dict(): only used in popup window, if_pyth and if_lua. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | | build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq2023-11-30
| |_|/ |/| | | | | | | | | | | | | | FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
* | | refactor: fix headers with IWYUdundargoc2023-11-28
| | |
* | | refactor: move hashtab types to hashtab_defs.h (#26262)zeertzjq2023-11-28
| | |
* | | refactor: rename types.h to types_defs.hdundargoc2023-11-27
| | |
* | | build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
| | |
* | | refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq2023-11-27
| | |
* | | refactor: move garray_T to garray_defs.h (#26227)zeertzjq2023-11-26
| | |
* | | refactor: remove __clang_analyzer__ macrodundargoc2023-11-21
| | | | | | | | | | | | | | | It is less intrusive to silence the warning with a comment instead of a macro if needed.
* | | refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | | | | | | | | | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
* | | refactor: follow style guidedundargoc2023-11-19
| | | | | | | | | | | | | | | - reduce variable scope - prefer initialization over declaration and assignment
* | | build: remove PVSdundargoc2023-11-12
| | | | | | | | | | | | | | | | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* | | refactor: remove redundant castsdundargoc2023-11-11
| | |
* | | refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | | | | | | | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
* | | refactor: the long goodbyedundargoc2023-11-05
| | | | | | | | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* | | vim-patch:9.0.2050: Vim9: crash with deferred function call and exception ↵zeertzjq2023-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25715) Problem: Vim9: crash with deferred function call and exception Solution: Save and restore exception state Crash when a deferred function is called after an exception and another exception is thrown closes: vim/vim#13376 closes: vim/vim#13377 https://github.com/vim/vim/commit/c59c1e0d88651a71ece7366e418f1253abbe2a28 The change in check_due_timer() is N/A as Nvim calls timer callbacks on the main loop. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | | vim-patch:9.0.2044: Vim9: exceptions confuse defered functionszeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: exceptions confuse defered functions Solution: save and restore exception state when calling defered functions closes: vim/vim#13364 closes: vim/vim#13372 https://github.com/vim/vim/commit/0672595fd50e9ae668676a40e28ebf66d7f52392 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | | feat: ignore swapfile for running Nvim processes #25336Justin M. Keyes2023-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The swapfile "E325: ATTENTION" dialog is displayed when editing a file already open in another (running) Nvim. Usually this behavior is annoying and irrelevant: - "Recover" and the other options ("Open readonly", "Quit", "Abort") are almost never wanted. - swapfiles are less relevant for "multi-Nvim" since 'autoread' is enabled by default. - Even less relevant if user enables 'autowrite'. Solution: Define a default SwapExists handler which does the following: 1. If the swapfile is owned by a running Nvim process, automatically chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile, which is mostly harmless and ignored except by `:recover` or `nvim -r`. 2. Shows a 1-line "ignoring swapfile..." message. 3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
* | | refactor: the long goodbyedundargoc2023-10-03
| | | | | | | | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* | | refactor: move cmdline completion types to cmdexpand_defs.h (#25465)zeertzjq2023-10-02
| | |
* | | refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
* | | build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
| | |
* | | refactor(message): smsg_attr -> smsgbfredl2023-09-29
| | |
* | | fix: use snprintf instead of sprintfLewis Russell2023-08-31
| | | | | | | | | | | | Clang 14 now reports sprintf as deprecated.
* | | refactor: use xstrl{cpy,cat} on IObuff (#23648)ii142023-05-16
| | | | | | | | | | | | | | | Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff Co-authored-by: ii14 <ii14@users.noreply.github.com>
* | | vim-patch:8.2.4075: test failureszeertzjq2023-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Test failures. Solution: Change check for NULL pointer. https://github.com/vim/vim/commit/78a70533c3707aa50cbf998c7807221945aa9787 :export is N/A. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | vim-patch:8.2.4073: Coverity warns for using NULL pointerzeertzjq2023-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity warns for using NULL pointer. Solution: Bail out when running out of memory. Check for running over end of a string. https://github.com/vim/vim/commit/54598066ca4cfaf0761aedf47e4ba9844674791e Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | vim-patch:8.2.1697: inconsistent capitalization of error messages (#23476)zeertzjq2023-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Inconsistent capitalization of error messages. Solution: Always start with a capital. https://github.com/vim/vim/commit/7707228aace9aff16434edf5377a354c6ad07316 Most of these errors are Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | vim-patch:9.0.1505: error when heredoc content looks like heredoc (#23446)zeertzjq2023-05-03
| | | | | | | | | | | | | | | | | | Problem: Error when heredoc content looks like heredoc. Solution: Handle curly expressions. (closes vim/vim#12325) https://github.com/vim/vim/commit/a93d9cdc74f70ca2c85781496ffae4ca738fcd88
* | | vim-patch:8.2.0578: heredoc for interfaces does not support "trim"zeertzjq2023-04-29
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Heredoc for interfaces does not support "trim". Solution: Update the script heredoc support to be same as the :let command. (Yegappan Lakshmanan, closes vim/vim#5916) https://github.com/vim/vim/commit/6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55
* | | refactor: uncrustifydundargoc2023-04-26
| | | | | | | | | | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* | | vim-patch:9.0.0875: using freed memory when executing delfunc at more prompt ↵zeertzjq2023-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#23314) Problem: Using freed memory when executing delfunc at the more prompt. Solution: Check function list not changed in another place. (closes vim/vim#11437) https://github.com/vim/vim/commit/398a26f7fcd58fbc6e2329f892edbb7479a971bb Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | fix(userfunc): fix possible out of bound accessAndreas Schneider2023-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from /usr/include/string.h:535, from gsrc/nvim/eval/userfunc.c:11: In function ‘strcpy’, inlined from ‘cat_func_name’ at gsrc/nvim/eval/userfunc.c:662:5, inlined from ‘get_user_func_name’ at gsrc/nvim/eval/userfunc.c:2854:5: /usr/include/bits/string_fortified.h:79:10: warning: ‘__builtin___strcpy_chk’ offset 0 from the object at ‘<unknown>’ is out of the bounds of referenced subobject ‘uf_name’ with ty pe ‘char[]’ at offset 0 [-Warray-bounds=] 79 | return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from gsrc/nvim/eval/typval.h:10, from gsrc/nvim/buffer_defs.h:20, from gsrc/nvim/autocmd.h:8, from gsrc/nvim/eval/userfunc.c:15: gsrc/nvim/eval/typval_defs.h: In function ‘get_user_func_name’: gsrc/nvim/eval/typval_defs.h:342:8: note: subobject ‘uf_name’ declared here 342 | char uf_name[]; ///< Name of function (actual size equals name); | ^~~~~~~
* | | vim-patch:9.0.1470: deferred functions invoked in unexpected order (#23199)zeertzjq2023-04-19
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Deferred functions invoked in unexpected order when using :qa and autocommands. Solution: Call deferred functions for the current funccal before using the stack. (closes vim/vim#12278) https://github.com/vim/vim/commit/1be4b81bfb3d7edf0e2ae41711d429e8fa5e0555
* | | vim-patch:9.0.1469: deferred functions not called from autocommandszeertzjq2023-04-19
| | | | | | | | | | | | | | | | | | | | | Problem: Deferred functions not called from autocommands. Solution: Also go through the funccal_stack. (closes vim/vim#12267) https://github.com/vim/vim/commit/960cf9119e3f4922ca9719feb5e0c0bc5e3b9840
* | | vim-patch:9.0.1462: recursively calling :defer function if it does :qazeertzjq2023-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Recursively calling :defer function if it does :qa. Solution: Clear the defer entry before calling the function. (closes vim/vim#12266) https://github.com/vim/vim/commit/42994bf678f46dc9ca66e49f512261da8864fff6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | vim-patch:9.0.0864: crash when using "!!" without a previous shell commandzeertzjq2023-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when using "!!" without a previous shell command. Solution: Check "prevcmd" is not NULL. (closes vim/vim#11487) https://github.com/vim/vim/commit/6600447c7b0a1be3a64d07a318bacdfaae0cac4b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | refactor: suppress clang false positives (#23154)zeertzjq2023-04-17
| | |
* | | vim-patch:9.0.0419: the :defer command does not check the function argumentszeertzjq2023-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The :defer command does not check the function argument count and types. Solution: Check the function arguments when adding a deferred function. https://github.com/vim/vim/commit/169003289fb4b2ad18fd7f5807e0d05efff0be85 Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer as first argument. Co-authored-by: Bram Moolenaar <Bram@vim.org>