In 3b12bb225a, ":oldfiles" was taught to
behave like Vim's ":browse oldfiles" if ":oldfiles!" was used. However,
this conflates the use of ! for abandoning a modified buffer with
choosing one file out of a list of oldfiles.
Now that ":browse" is supported again, ":browse oldfiles" will allow the
user to select an old file, while still complaining if that would cause
a modified buffer to be abandoned. ":browse oldfiles!" will just
abandon the buffer, as expected.
menu_spec.lua yanks to the clipboard, but never pastes from it. This
can leave a child xsel process waiting around for something to paste the
content, causing the test process to hang.
Since the test isn't explicitly trying to exercise the clipboard, simply
use the default register.
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
The directories table contains the names of the expected directory names
for varying scopes of the :cd tests. Using named indexes, instead of
numbered, makes the test more readable.
Build wcwd/tcwd and wlwd/tlwd on top of the reworked cwd/lwd functions.
This will allow for easier testing of `getcwd()`/`haslocaldir()` in
arbitrary windows and/or tab pages.
While trying to debug an issue, I discovered that the tests for illegal
arguments depended on the prior suite having run and started a session.
Let's remove that unintentional dependency by starting our own session
before each test.
This change effectively disables history for lines inserted using this method.
Not a big problem since it does not work for them in Vim in first place.
Also solves a bug(?): ex_window() run while in :append mode opens search history
in Vim for some reason. Now it opens empty cmdline window.
When backupcopy=auto buf_write assumes backupcopy=yes when the file is a
hard/symbolic link. However this check was guarded by a UNIX ifdef. The
check itself is portable and the guard can be removed.
Added a couple tests to check the behaviour of bkc=auto and bkc=no
with a symbolic link.
Reported in #4525
New ex commands: 'tcd', 'tchdir'
Changed Vimscript functions: 'haslocaldir', 'getcwd'
The ex-commands ':tcd' and ':tchdir' are the tab-local equivalents of
':lcd' and ':lchdir'. There are no new Vimscript functions introduced,
instead the functions 'haslocaldir' and 'getcwd' take in optional
arguments. See the documentation for details
Since there is now different levels of local directory a simple boolean
at source level is no longer sufficient; a new enumeration type is used
for the scope-level from now on.
The documentation has been accommodated for these new commands and
functional tests have been written to test the feature.
- change approach for test 1: screen:expect() instead of assert()
- use execute() instead of command()
- 2 new tests that check none and wrong input for :oldfiles!
Helped-by: @fwalch
Helped-by: @tarruda
Helper-by: @justinmk
A menu item can have separate bindings for each Vim mode.
:emenu checks to see which binding it should execute. But, it assumes
it can only be called from Normal mode, so its mode detection is based
on some guesswork. For instance, it detects if you've just used C-O
and, if so, uses the Insert mode binding.
Now that :emenu can be called from any mode (via vim_command), this
commit has it check the actual mode we're in, and simply use the
binding for that mode if we aren't in Normal mode.
os.remove() wasn't removing the temporary swap directory which leads to
problems when the test is run a second time.
That's also the reason why the CI never caught this.
os.remove() got replaced by helpers.rmdir().
Since the introduction of the FOR_ALL_BUFFERS macro, 'sign unplace id'
without a buffer was only removing the sign from the first buffer rather
than all buffers, as described in the documentation.
:help sign-unplace
--
modeline discussion: https://github.com/akkartik/neovim/commit/7863c247db#commitcomment-8342590