The "mapping" tests added in 541dde36e3 were flawed:
- Unlike op-pending mode, RPCs are _blocked_ during map-pending. So
a synchronous RPC like nvim_get_current_buf() waits until
'timeoutlen', then the mapping is canceled.
- helpers.expect() also performs a blocking RPC, so again that must not
intervene the two nvim_input() calls.
closes#6166
normal_finish_command() and normal_prepare() assume that any pending
operator needs to be finished after any subsequent key.
Set `finish_op = false` in nv_event() to indicate that the pending
operator shouldn't be finished in normal_execute().
This is how nv_visual() indicates that 'v' or 'V' in operator-pending
mode should not finish the current pending operator.
fixes#5398fixes#6166 (partially; mappings are still interrupted)
- Show hint only once per session.
- provider#clipboard#Call(): prevent recursion
- provider#clear_stderr(): use has_key(), because :silent! is still
captured by :redir.
closes#7184
- :hi Normal works with -u NONE
- Makes HL_TABLE and ATTR_ENTYRY a function instead of a macro so that in can be used in gdb.
- Introduces ATTRENTRY_INIT to init attrentry_t
Problem: The packadd test does not create the symlink correctly and does
not test the right thing.
Solution: Create the directory and symlink correctly.
644df41c44
Problem: When using a symbolic link, the package path will not be inserted
at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution: Resolve symbolic links when finding the right position in
'runtimepath'. (Hirohito Higashi)
2f9e575583
Problem: C indenting does not support nested namespaces that C++ 17 has.
Solution: Add check that passes double colon inside a name. (Pauli, closes
vim/vim#1214)
ca8b8d6956
start_batch_changes() doesn't avoid invoking the clipboard
once-per-line, because the loop is actually in ex_echo(), which calls
redir_write() for each message. But we've already entered
start_batch_changes() by then, so that was never the problem.
redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523
msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600
msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221
ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433
do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242
Trying to defer _explicit_ clipboard updates is difficult.
:redir @+ | silent echo system('cat foo') | redir END
is essentially equivalent to:
for l in readfile('foo')
let @+ .= l
endfor
We cannot make judgements about when to ignore a script's bad decisions.
start_batch_changes() only works around the case of clipboard=unnamed,
i.e. _implicit_ clipboard updates (`:g/foo/d`). Not explicit
assignment.
redir_write():
- This is a "batch" operation which was not yet covered by
start_batch_changes()
adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
Rather than deal with the mess, show a non-error message.
closes#7182closes#7184closes#7183
ref #6048
ref #7032
To deal with SIGWINCH limitations on Windows, change some resize tests
to _shrink_ the screen width. ... But this didn't work, so still
ignoring those tests on Windows.
Closes#4370
Explication:
In the backtrace in #4370, we see that `buf_write()` was called with
non-NULL `fname` and `sfname` arguments, but they've since _become_
NULL.
#7 0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go",
sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0,
forceit=0, reset_changed=1, filtering=0)
at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576
This is most likely due to the code that restores those values from
`buf`, which happens just before the fatal call to `os_fileinfo`
```c
/*
* The autocommands may have changed the name of the buffer, which may
* be kept in fname, ffname and sfname.
*/
if (buf_ffname)
ffname = buf->b_ffname;
if (buf_sfname)
sfname = buf->b_sfname;
if (buf_fname_f)
fname = buf->b_ffname;
if (buf_fname_s)
fname = buf->b_sfname;
```
It's worth noting that at this point `ffname` is still non-NULL, so
it _could_ be used. However, our current code is purely more strict
than Vim in this area, which has caused us problems before (e.g.,
`getdigits()`). The commentary for `struct file_buffer` clearly
indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be
NULL:
```c
/*
* b_ffname has the full path of the file (NULL for no name).
* b_sfname is the name as the user typed it (or NULL).
* b_fname is the same as b_sfname, unless ":cd" has been done,
* then it is the same as b_ffname (NULL for no name).
*/
char_u *b_ffname; /* full path file name */
char_u *b_sfname; /* short file name */
char_u *b_fname; /* current file name */
```
Vim directly calls `stat(2)` which, although it is annotated to tell
the compiler that the path argument is non-NULL, does handle a NULL
pointer by returning a `-1` value and setting `errno` to `EFAULT`.
This satisfies Vim's check, since it treats any `-1` return from
`stat(2)` to mean the file doesn't exist (at least in this code
path).
Note that Vim's mch_stat() implementations on win32 and solaris
clearly cannot accept NULL `name`. But the codepaths that call
mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!