| Commit message (Collapse) | Author | Age |
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
It is less intrusive to silence the warning with a comment instead of a
macro if needed.
|
| |
| |
| |
| |
| |
| | |
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
|
| |
| |
| |
| |
| | |
- reduce variable scope
- prefer initialization over declaration and assignment
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
When the given length is exactly the number of bytes to copy, xmemdupz()
makes the intention clearer.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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`.
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| | |
- 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
|
| | |
|
| | |
|
| |
| |
| |
| | |
Clang 14 now reports sprintf as deprecated.
|
| |
| |
| |
| |
| | |
Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff
Co-authored-by: ii14 <ii14@users.noreply.github.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
Problem: Error when heredoc content looks like heredoc.
Solution: Handle curly expressions. (closes vim/vim#12325)
https://github.com/vim/vim/commit/a93d9cdc74f70ca2c85781496ffae4ca738fcd88
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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);
| ^~~~~~~
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Deferred functions not invoked when partial func exits.
Solution: Create a funccall_T when calling a :def function.
https://github.com/vim/vim/commit/9667b2c888351b04751bdb43cba0d4ffc8c13ab1
The remove_funccal() function is currently unused, but it will be used
in patch 9.0.0618.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: number of arguments is not always checked. (Yegappan
Lakshmanan)
Solution: Check number of arguments when calling function by name.
https://github.com/vim/vim/commit/5082471f91dd42ed8c35e0f649d0a6572e6fe3fc
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Members of funccall_T are inconsistently named.
Solution: Use the "fc_" prefix for all members.
https://github.com/vim/vim/commit/ca16c60f337ed33d5dd66a6e90aaf95b619c5e47
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Unnecessary checks for the "skip" flag when skipping.
Solution: Remove the unnecessary checks. (closes vim/vim#12254)
https://github.com/vim/vim/commit/5299c0933f942c61bfd48064c91365e518fa868c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
https://github.com/vim/vim/commit/6f14da15ac900589f2f413d77898b9bff3b31ece
vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry
Problem: Dec mouse test fails without gnome terminfo entry.
Solution: Check if there is a gnome entry. Also fix 'acd' test on
MS-Windows. (Dominique Pellé, closes vim/vim#9282)
https://github.com/vim/vim/commit/f589fd3e1047cdf90566b68aaf9a13389e54d26a
Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: :defer not tested with exceptions and ":qa!".
Solution: Test :defer works when exceptions are thrown and when ":qa!" is
used. Invoke the deferred calls on exit.
https://github.com/vim/vim/commit/58779858fb5a82a3233af5d4237a3cece88c10d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cannot use a partial with :defer.
Solution: Add the partial arguments before the other arguments. Disallow
using a dictionary.
https://github.com/vim/vim/commit/86d87256c4005c6215da5af2597fbf6f6304421f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cleaning up after writefile() is a hassle.
Solution: Add the 'D' flag to defer deleting the written file. Very useful
in tests.
https://github.com/vim/vim/commit/806a273f3c84ecd475913d901890bb1929be9a0a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cleaning up afterwards can make a function messy.
Solution: Add the :defer command.
https://github.com/vim/vim/commit/1d84f7608f1e41dad03b8cc7925895437775f7c0
Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Confusing error for using a variable as a function.
Solution: If a function is not found but there is a variable, give a more
useful error. (issue vim/vim#9310)
https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| | |
It's for Vim9 script only.
|