Problem: Recursively calling :defer function if it does :qa in a compiled
function.
Solution: Clear the defer entry before calling the function. (closesvim/vim#12271)
a1f2b5ddc6
Problem: Recursively calling :defer function if it does :qa.
Solution: Clear the defer entry before calling the function. (closesvim/vim#12266)
42994bf678
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using "!!" without a previous shell command.
Solution: Check "prevcmd" is not NULL. (closesvim/vim#11487)
6600447c7b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: ":!" doesn't do anything but does update the previous command.
Solution: Do not have ":!" change the previous command. (Martin Tournoij,
closesvim/vim#11372)
8107a2a8af
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Ruler not drawn correctly when using 'rulerformat'.
Solution: Adjust formatting depending on whether the ruler is drawn in the
statusline or the command line. (Sean Dewar, closesvim/vim#12246)
fc8a601c32
This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Problem: The :defer command does not check the function argument count and
types.
Solution: Check the function arguments when adding a deferred function.
169003289f
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.
9667b2c888
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: Invalid memory access with bad 'statusline' value.
Solution: Avoid going over the NUL at the end.
7b17eb4b06
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Invalid memory access with recursive substitute expression.
Solution: Check the return value of vim_regsub().
3ac1d97a1d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Invalid memory access in substitute with function that goes to
another file.
Solution: Check for text locked in CTRL-W gf.
cc762a48d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: C++ 20 modules are not recognized.
Solution: Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson,
closesvim/vim#12261)
732d69e191
Co-authored-by: Ben Jackson <puremourning@gmail.com>
Problem: Code for making 'shortmess' temporarily empty is repeated.
Solution: Add functions for making 'shortmess' empty and restoring it.
(Christian Brabandt, closesvim/vim#11709)
9aee8ec400
Co-authored-by: Christian Brabandt <cb@256bit.org>
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.
6f14da15ac
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é, closesvim/vim#9282)
f589fd3e10
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.
58779858fb
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.
86d87256c4
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.
806a273f3c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cleaning up afterwards can make a function messy.
Solution: Add the :defer command.
1d84f7608f
Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test fails because of using Vim9 syntax in legacy function.
Solution: Add "call".
4f16e9de98
Add test_nested_function.vim changes from patches 8.{0.0141,2.1432}.
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)
2ef9156b42
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using a null function reference. (Naohiro Ono)
Solution: Check for an invalid function name. (closesvim/vim#8367)
22db0d549f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when passing NULL function to reduce().
Solution: Check for NULL pointer and give an error. (Dominique Pellé,
closesvim/vim#7243)
0d90e728fe
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Memory allocation failure not tested when defining a function.
Solution: Add a test. (Yegappan Lakshmanan, closesvim/vim#10127)
7c7e19cf50
test_alloc_fail() is N/A.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getscriptinfo() loops even when specific SID is given.
Solution: Only loop when needed. Give a clearer error message.
(closesvim/vim#12207)
2d68b722e3
Problem: It is not easy to get information about a script.
Solution: Make getscriptinf() return the version. When selecting a specific
script return functions and variables. (Yegappan Lakshmanan,
closesvim/vim#10991)
2f892d8663
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getscriptinfo() does not include the version. Cannot select
entries by script name.
Solution: Add the "version" item and the "name" argument. (Yegappan
Lakshmanan, closesvim/vim#10962)
520f6ef60a
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: String interpolation fails when not evaluating.
Solution: Skip the expression when not evaluating. (closesvim/vim#10398)
70c41241c2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Interpolated string expression requires escaping.
Solution: Do not require escaping in the expression.
0abc2871c1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: String interpolation only works in heredoc.
Solution: Support interpolated strings. Use syntax for heredoc consistent
with strings, similar to C#. (closesvim/vim#10327)
2eaef106e4
Cherry-pick Test_Debugger_breakadd_expr() from Vim.
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Heredoc expression evaluated even when skipping.
Solution: Don't evaluate when "skip" is set. (closesvim/vim#10306)
05c7f5d3d0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: not enough tests.
Solution: Run more expression tests also with Vim9. Fix an uncovered
problem.
fea43e44c0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot put space between function name and paren.
Solution: Allow this for backwards compatibility.
bbd3e3c357
This fixes a regression from patch 8.2.1365, which isn't ported yet.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using channel or job with ":execute" has strange effects.
Solution: Give an error message for Job and Channel.
b662591e50
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using null object with execute() has strange effects.
Solution: Give an error message ofr Job and Channel.
e2a8f0773e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Messages test fails in small version.
Solution: Only use test_null_job() when available.
da292b07af
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: "exit_cb" causes Vim to exit.
Solution: Require white space after a command in Vim9 script. (closesvim/vim#7467)
Also fix that Vim9 style heredoc was not always recognized.
b5b9480ee9
Omit EX_NONWHITE_OK, E1143, E1144: Vim9 script only.
Cherry-pick test_vimscript.vim changes from patch 8.2.2141.
Cherry-pick E1145 tag from Vim runtime.
N/A patches for version.c:
vim-patch:8.2.2140: build failure with tiny features
Problem: Build failure with tiny features.
Solution: Add #ifdef.
2a3cd3af45
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No falsy Coalescing operator.
Solution: Add the "??" operator. Fix mistake with function argument count.
92f26c256e
Cherry-pick tv2bool() into eval/typval.c.
Cherry-pick *??* tag from Vim runtime.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no line break allowed inside a list.
Solution: Handle line break inside a list in Vim9 script.
7147820cb9
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when passing NULL to setcmdline(). (Andreas Louv)
Solution: Use tv_get_string() instead of using v_string directly.
(closesvim/vim#12231, closesvim/vim#12227)
ac6cd31afc
Problem: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closesvim/vim#12237)
05a627c3d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: .fs files are falsely recognized as forth files.
Solution: Check 100 lines for something that looks like forth. (Johan
Kotlinski, closesvim/vim#12219, closesvim/vim#11988)
065088d554
Co-authored-by: Johan Kotlinski <kotlinski@gmail.com>
Problem: Livebook files are not recognized.
Solution: Add a pattern for Livebook files. (Mathias Jean Johansen,
closesvim/vim#12203)
6400203517
Co-authored-by: Mathias Jean Johansen <mathias@mjj.io>
Problem: Cursor in wrong position when leaving insert mode.
Solution: Update the w_valid flags. Position the cursor also when not
redrawing. (closesvim/vim#12137)
c174c2e58c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Indent wrong after "export namespace" in C++.
Solution: Skip over "inline" and "export" in any order. (Virginia Senioria,
closesvim/vim#12134, closesvim/vim#12133)
99e4ab2a1e
Co-authored-by: Virginia Senioria <91khr@users.noreply.github.com>
Problem: "wat" and "wast" files are one filetype.
Solution: Add a separate filetype for "wat" files. (Amaan Qureshi,
closesvim/vim#12165)
3ea62381c5
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
vim-patch:9.0.1419: Lean files are not recognized
Problem: Lean files are not recognized.
Solution: Add a pattern for Lean files. (Amaan Qureshi, closesvim/vim#12177)
4a5c39fc52
vim-patch:9.0.1421: Nu files are not recognized
Problem: Nu files are not recognized.
Solution: Add a pattern for Nu files. (Amaan Qureshi, closesvim/vim#12172)
8aa2a37f89
vim-patch:9.0.1422: Sage files are not recognized
Problem: Sage files are not recognized.
Solution: Add a pattern for Sage files. (Amaan Qureshi, closesvim/vim#12176)
d0639d717b
vim-patch:9.0.1423: WebAssembly Interface Type files are not recognized
Problem: WebAssembly Interface Type files are not recognized.
Solution: Add a pattern for WIT files. (Amaan Qureshi, closesvim/vim#12173)
890c772036
existing behavior of
:=
and
:[range]=
are unchanged. `|` is still allowed with this usage.
However,
:=p
and similar are changed in a way which could be construed as a breaking
change. Allowing |ex-flags| for := in the first place was a mistake as
any form of := DOES NOT MOVE THE CURSOR. So it would print one line number
and then print a completely different line contents after that.
Problem:
On Windows, :make does not display the output of the program it runs.
The cause is the default 'shellpipe'. On Linux, nvim uses `tee` to redirect the
output to both stdout and the error file. In Windows, for both cmd.exe and
powershell, the output is only redirected to the error file.
Solution:
- On Windows, change the 'shellpipe' default to "2>&1| tee".
- Nvim includes `tee` in its Windows package.
- Document recommended defaults for powershell.
Fixes#12910
Problem: ILE RPG files are not recognized.
Solution: Add patterns for ILE RPG files. (Andreas Louv, issue vim/vim#12152)
e202ec8a0c
Co-authored-by: Andreas Louv <andreas@louv.dk>
we cannot remove 'paste'. It is very common in plugins and configs.
'pastetoggle' can and should be removed though, it's a total waste of everyone's time because it generates bug reports and doesn't work well, and is useless because bracketed-paste works better.
Problem: Autoload script sourced twice if sourced directly.
Solution: Do not source an autoload script again. (issue vim/vim#6644)
daa2f36573
Cherry-pick ret_sid changes from patch 8.2.0149.
Use do_in_runtimepath() as that's what source_runtime() calls in Nvim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot easily get the list of sourced scripts.
Solution: Add the getscriptinfo() function. (Yegappan Lakshmanan,
closesvim/vim#10957)
f768c3d19c
Cherry-pick usr_41.txt change from a later runtime update.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Highlight for popupmenu kind and extra cannot be set.
Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
highlight groups and use them. (Gianmaria Bajo, closesvim/vim#12114)
6a7c774920
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
Problem: Expression "!expr->func()" does not work.
Solution: Apply plus and minus earlier. (closesvim/vim#6348)
0b1cd52ff6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using NULL pointer with nested :open command.
Solution: Check that ccline.cmdbuff is not NULL.
7ac5023a5f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Value of MAXCOL not available in Vim script.
Solution: Add v:maxcol. (Naohiro Ono, closesvim/vim#9451)
56200eed62
The variable is always 2147483647, but introducing it makes functions
easier to document.
Co-authored-by: naohiro ono <obcat@icloud.com>