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
Problem: When "syntax manual" was used switching between buffers removes
the highlighting.
Solution: Set the syntax option without changing the value. (Anton
Lindqvist)
885f24fbca
Patch applied cleanly to the nvim sources except for version.c.
Problem: The fix in patch 7.3.192 is not tested.
Solution: Add a test, one for each regexp engine. (Elias Diem)
96c664af27
The patch was applied to 044_099_regexp_multibyte_magic_spec.lua as
these two legacy tests (44 and 99) were merged together (and
de-duplicated) in Neovim.
- Code from Vim source.
- Removed the check for 'guioptions'
- mouse_spec.lua: test <ScrollWheelLeft> and <ScrollWheelRight>
- Move horizontal scroll logic to mouse.c
- Remove 'gui_' from the function names
- Renamed variables to be more specific (as opposed to generic p, w).
- Marked some functions as `static`
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.
Problem: Vim can create a directory but not delete it.
Solution: Add an argument to delete() to make it possible to delete a
directory, also recursively.
da440d21a6
vim-patch:35e7594
35e7594dd4
"Add missing test files from 7.4.634 to the repository."
The discrepancy between the expected getpos() result of the old test
[0, 15, 2, 0] and the converted test [0, 3, 2, 0] is just a matter of how
the buffer is constructed: in the old Vim test the buffer has a bunch of
junk at the top.
The central purpose of the test is to verify that the getpost("'a") does
*not* return [0, 0, 0, 0].
Adds two undocumented v: variables: _null_list and _null_dict because I do not
know a reproducible way to get such lists (though I think I heard about this)
and dictionaries (do not remember hearing about them). NULL strings are obtained
using $XXX_UNEXISTENT_VAR_XXX.
Fixes crash in json_encode($XXX_UNEXISTENT_VAR_XXX). Other added tests worked
fine before this commit.
Note: currently they are both *dumped*, but parsing them produces an error. This
is inappropriate: variables should either be skipped with error message when
dumping or should be read back properly.
It also appears that I did not have test for “has wrong variable value type”
error, so nothing got removed from errors_spec.
Special dictionaries representing map are created when encountering duplicate
key or when key is empty or contains NUL.
Also checks that values are separated by a comma/colon properly.
Having a tags file in the calling directory of make test would make this test
fail, so disable tag file completion for it. Disable all other options except the
current buffer, to, applying the principle of least surprise.
-1 is index past the end, and -2 is the index of the last element.
This eliminates the need for include_start/include_end.
Allow the handling of out-of-bounds to be configurable.
-NaN doesn't exist in the IEEE 754 spec, it is a hardware-specific detail
abstracted away by luajit(and not by lua or nvim), so there's no need to test
it. Normalize all tests that involve -nan so the suite will be compatible with
both Lua and Luajit.
The hexadecimal notation is a Luajit extension which is not compatible with Lua
5.1. While Lua 5.2 does support hexadecimal sequences, it is better to target
Lua 5.1 for maximum compatibility with Luajit(which has fully compatible with
5.1 API/ABI).
Problem: When using slices there is a mixup of variable name and namespace.
Solution: Recognize variables that can't be a namespace. (Hirohito Higashi)
9bbf63dbf8
All syntastic users experienced this problem:
E685: Internal error: get_tv_string_buf()
It's reproducable with:
:call setloclist(0, [''])
So, not given optional arguments to setloclist() lead to some fields not
inizilied and the code took the wrong branches.
Adds support for:
- api:vim_input("<D-a>")
- ":nnoremap <C-D-S-...>" and permutations thereof
UIs must capture the modifier and send it as "<D-...>" to vim_input().
Note: Before this commit, any arbitrary ":nnoremap <{foo}-{bar}>"
mapping could already be invoked with feedkeys("\<{foo}-{bar}>"). This
commit supports "D-" as a modifier that can be combined with "C-", "A-",
"S-" in any order.
For non-GUI (terminal) support, user must:
:set <D-a>={CSI sequence}
then send the {CSI sequence} from their terminal. But this does not work
yet (regression #2204).
Closes#2190
Problem: Completing the longest match doesn't work properly with multi-byte
characters.
Solution: When using multi-byte characters use another way to find the
longest match. (Hirohito Higashi)
4f8fa1633c
Problem: C indenting is wrong below a "case (foo):" because it is
recognized as a C++ base class construct. Issue #38.
Solution: Check for the case keyword.
d1b15dec4d
Problem: Indentation of array initializer is wrong.
Solution: Avoid that calling find_start_rawstring() changes the position
returned by find_start_comment(), add a test. (Hirohito Higashi)
089af18d1f
The test was split into several blocks reusing the same input file. As it is
complicated to send text in different encodings and with control characters
from the test suite to nvim and back the results are written to a temp file
and loaded into the test from there.
Some parts of the test depend on gzip(1). They are skipped if gzip is not
available.
Some `:write` and `:edit` commands produce messages and "hit enter" prompts
that had to be treated with an extra `feed('<C-L>')`. In the original test
file this was not neccessary because it was `:source!`ed.
If the build directory path has symlinks in it, 'make functionaltest'
fails at shada_spec.lua:177 because readme_fname has symlink but
nvim resolves the symlink when writing it into the shada file.
Problem: "gv" after paste selects one character less if 'selection' is
"exclusive".
Solution: Increment the end position. (Christian Brabandt)
d29c6fea94
Problem: ml_get error when using "p" in a Visual selection in the last
line.
Solution: Change the behavior at the last line. (Yukihiro Nakadaira)
d009e86826
Problem: gettabvar() doesn't work after Vim start. (Szymon Wrozynski)
Solution: Handle first window in tab still being NULL. (Christian Brabandt)
7e47d1ac6a
Problem: When removing from 'path' and then adding, a comma may go missing.
(Malcolm Rowe)
Solution: Fix the check for P_ONECOMMA. (closes#471)
174674743d
The test involves argument and buffer numbers. Therefore it was necessary to
use a custom testing session to ensure that the initial buffer corresponds to
an argument.
Plugins (YCM, dispatch.vim) use gui_running to decide behavior; so do
some colorschemes. Up to now, nvim lied about gui_running for the
benefit of colorschemes and the detriment of all _other_ plugins that
check this condition. That's counterproductive: a user employs at most
_one_ colorscheme but may use many other plugins which expect the Vim
legacy semantics of gui_running.
Moreover, colorschemes usually don't _need_ to check gui_running: they
can instead set cterm{fg,bg} and gui{fg,bg} in the same :highlight call.
It is reasonable for users who want "true color" to modify their
colorscheme once (or request upstream to do so) in order to avoid
running into quirks in any other plugins.
Closes#2782
Problem: When using += with ":set" a trailing comma is not recognized.
(Issue 365)
Solution: Don't add a second comma. Add a test. (partly by Christian
Brabandt)
a7b7b1cef9
Problem: The entries added by matchaddpos() are returned by getmatches()
but can't be set with setmatches(). (Lcd)
Solution: Fix setmatches(). (Christian Brabandt)
0fce425772
Problem: Illegal memory access when using :copen and :cclose.
Solution: Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
Add a test.
62ef797496
Problem: ":tabmove" does not work as documented.
Solution: Make it work consistently. Update documentation and add tests.
(Hirohito Higashi)
40ce3a4e1f
Problem: test_listlbr_utf8 sometimes fails.
Solution: Don't use a literal multibyte character but <C-V>uXXXX. Do not
dump the screen highlighting. (Christian Brabandt, closes#518)
1c57fe8b94
Problem: When using 'colorcolumn' and there is a sign with a fullwidth
character the highlighting is wrong. (Andrew Stewart)
Solution: Only increment vcol when in the right state. (Christian Brabandt)
32a214e78d
Problem: Appending in Visual mode with 'linebreak' set does not work
properly. Also when 'selection' is "exclusive". (Ingo Karkat)
Solution: Recalculate virtual columns. (Christian Brabandt)
74db34cc91
As the work of this migration did take quite some time, some changes where
made in master after this branch was started. These are ported to the new
test file.
The old test_eval.in file did a `:wq` on line 168. The following 60 lines
where not used and there was no expected output for them in test_eval.ok.
This test code is now used in several test cases in the new test file.
This is consistent with VIM behavior. When showing a visual selection,
VIM only extends it past the last character if eol is in listchars (even
if nolist is set).
vim-patch:7.4.569
vim-patch:7.4.573
Helped-by: @glts https://github.com/neovim/neovim/pull/2621
Problem: Having CTRL-C interrupt or not does not check the mode of the
mapping. (Ingo Karkat)
Solution: Use a bitmask with the map mode. (Christian Brabandt)
651863c94a
Problem: Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution: Call get_real_state() instead of using State directly.
5000869712
Background: Vim internally prefers to represent ALT/META chords as
single-byte keys, by setting the high bit of the key byte.
extract_modifiers() _discards_ the meta/alt modifier, but we need it for
libvterm and libtermkey.
Closes#2440Closes#3727Closes#2017
References #2277
References #2254https://github.com/neovim/neovim/issues/2017#issuecomment-140423557
> We [not libtermkey] are setting the high bit for some reason
https://github.com/neovim/neovim/issues/176#issuecomment-77834715
> libvtermkey requires the leading esc to parse alt/meta
https://github.com/neovim/neovim/pull/3246#issuecomment-136328450
> A program could do better than the current logic on some terminals, by
> asking for pure 8bit mode (S8C1T) and then immediately querying the
> mode again. If the result comes back as an 8bit single-byte CSI, then
> it can presume the mode setting was successful, and now the ESC prefix
> byte won't be seen in multibyte sequences; only as an Alt- prefix or
> a real Escape key. On such a terminal, it could therefore avoid
> needing to use that waiting timeout.
When converting a msgpack object to a String object, strings (and byte
arrays) with length 0 are handled as errors. This is fixed by
always using the msgpack data pointer as a valid pointer. For a NULL
pointer there is nothing to copy.
Test by @snoe
Fixes#3844
The tests would leave the following test files in the root directory:
Xtest-functional-plugin-shada.shada
Xtest-functional-plugin-shada.shada.tmp.f
Clean them up in teardown().
Note: it looks like viminfo files do not store search direction intentionally.
After reading viminfo file search direction was considered to be “forward”.
Note 2: all files created on earlier Neovim version will automatically receive
“forward” direction.
Fixes#3580