Problem:
`vim.split('a:::', ':', {trimempty=true})` trims inner empty items.
Regression from 9c49c10470
Solution:
Set `empty_start=false` when first non-empty item is found.
close#23212
Problem: ":drop fname" may change the last used tab page.
Solution: Restore the last used tab page when :drop has changed it.
(closesvim/vim#12087)
8281a16efc
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Profile completion test sometimes fails.
Solution: Delete the .res file before running tests.
7e0be3ea21
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Deferred functions invoked in unexpected order when using :qa and
autocommands.
Solution: Call deferred functions for the current funccal before using the
stack. (closesvim/vim#12278)
1be4b81bfb
This was originally meant as a convenience but prevents possible
functionality. For example:
-- Get the keys of the table with even values
local t = { a = 1, b = 2, c = 3, d = 4 }
vim.iter(t):map(function(k, v)
if v % 2 == 0 then return k end
end):totable()
The example above would not work, because the map() function returns
only a single value, and cannot be converted back into a table (there
are many such examples like this).
Instead, to convert an iterator into a map-like table, users can use
fold():
vim.iter(t):fold({}, function(t, k, v)
t[k] = v
return t
end)
If pack() is called with a single value, it does not create a table; it
simply returns the value it is passed. When unpack is called with a
table argument, it interprets that table as a list of values that were
packed together into a table.
This causes a problem when the single value being packed is _itself_ a
table. pack() will not place it into another table, but unpack() sees
the table argument and tries to unpack it.
To fix this, we add a simple "tag" to packed table values so that
unpack() only attempts to unpack tables that have this tag. Other tables
are left alone. The tag is simply the length of the table.
Problem: Jenkinsfiles are not recognized as groovy.
Solution: Add a pattern for Jenkinsfiles. (closesvim/vim#12236)
142ffb024d
Co-authored-by: dundargoc <gocdundar@gmail.com>
Problem: Reporting swap file when windows are split.
Solution: Close extra windows after running a test.
e5eae82bb7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Tests call GetSwapFileList() before it is defined.
Solution: Move the call to after defining the function. (Christopher
Plewright)
6572a90287
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Tests may get stuck in buffer with swap file.
Solution: Bail out when bwipe! doesn't get another buffer.
fa2533c8bb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Stray warnings for existing swap files.
Solution: Wipe out the buffer until it has no name and no swap file.
23526d2539
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test for catch after interrupt is flaky on MS-Windows.
Solution: Mark the test as flaky.
72b5b0d51a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test for swapfilelist() fails on MS-Windows.
Solution: Only check the tail of the path. Mark a test as flaky.
6cf3151f0e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: There is no way to get a list of swap file names.
Solution: Add the swapfilelist() function. Use it in the test script to
clean up. Remove deleting individual swap files.
c216a7a21a
vim-patch:9.0.1005: a failed test may leave a swap file behind
Problem: A failed test may leave a swap file behind.
Solution: Delete the swap file to avoid another test to fail. Use another
file name.
d0f8d39d20
Cherry-pick test_window_cmd.vim changes from patch 8.2.1593.
Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When a test gets stuck it just hangs forever.
Solution: Set a timeout of 30 seconds.
3bcd0ddc2d
Note: This doesn't cause test_timers.vim failures in Nvim because there
is a SetUp() function that calls timer_stopall().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Elapsed time since testing started is not visible.
Solution: Show the elapsed time while running tests.
b9093d5009
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When a test is slow and CI times out there is no time info.
Solution: Add the elapsed time to the "Executing" message.
daaa3d9965
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Terminal test sometimes hangs.
Solution: Add a bit more information to the test output. (issue vim/vim#11179)
a22c56a59a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: MS-Windows: "%T" time format does not appear to work.
Solution: Use "%H:%M:%S" instead.
5fbbec180b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: A failing flaky test doesn't mention the time.
Solution: Add the time for debugging. Improve error message.
06d32a0c17
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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>
vim.iter wraps a table or iterator function into an `Iter` object with
methods such as `filter`, `map`, and `fold` which can be chained to
produce iterator pipelines that do not create new tables at each step.
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.
Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).
This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.
Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.
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>
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
option, which allows for rendering e.g., diagnostic severities differently.
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>