This documents 256-colour and true colour handling, cursor shapes,
and scrolling regions.
Almost all of these headings are taken from the Vim doco, so that
the :help commands that people learn are a transferable skill.
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
tests to keep them fast.
TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
The "technically correct" interpretation is to execute the first line
that is seen (and this is what happens on middle-click paste in Vim).
^M is only intended to "defuse" the newline, so the user can review it.
The parent commit changed the behavior to insert <Space> between lines,
but that's a higher-risk change: it is arguably possible that some user
*wants* the literal ^M chars when e.g. assigning to a register:
:let @a='<C-R>b'
To avoid that risk, keep the old behavior and only omit the last ^M.
This makes `yy:<C-R>0` nicer at no cost.
^M isn't any more "correct" than space: the "technically correct"
interpretation is to execute the first line that is seen (and this is
what happens on middle-click paste in Vim). ^M is only intended to
defuse the newline, so that the user can review the command. We can do
that with a space instead, and then the command can be executed without
having to fix it up first.
This allows executables to be found by :!, system(), and executable() if
they live next to ("sibling" to) nvim.exe. This is what gvim on Windows
does, and also matches the behavior of Win32 SearchPath().
c4a249a736/src/os_win32.c (L354-L370)
This default causes too much confusion for terminal users. Until
a better approach is implemented, revert to the traditional default.
Better solution would be:
- Implement a right-click menu for TUI
- Set 'mouse=a' *only* if clipboard is working.
Closes#5938
This ameliorates use-cases like:
:!cat foo.txt
:make
where the user is interested in the last few lines of output.
Try these shell-based ex-commands before/after this commit:
:grep -r '' *
:make
:!yes
:!grep -r '' *
:!git grep ''
:!cat foo
:!echo foo
:!while true; do date; done
:!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done
In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
:!yes
:!while true; do date; done
:!git grep ''
:grep -r '' *
After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
* 10KB received
* ~1s throttled
This also avoids out-of-memory which could happen with large :! outputs.
Note: This commit does not change the behavior of execute(':!foo').
execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
messages, *not* shell command output. Vim behaves the same way.
Use system('foo') for capturing shell command output.
Closes#1234
Helped-by: oni-link <knil.ino@gmail.com>
'inccommand' allows us to expand the feature to other commands, such as:
:cdo
:cfdo
:global
Also rename "IncSubstitute" highlight group to "Substitute".
- Eliminate/isolate static/global variables
- Remove special-case parameter from buflist_new()
- Remove special-case ECMD_RESERVED_BUFNR
- To determine when u_undo_and_forget() should be done, check
b_changedtick instead of a heuristic.
- use mb_string2cells() instead of strlen() to measure the :sub patterns
- call ml_close() before buf_clear_file(). Avoids leaks caught by ASan.
Original patch by:
Robin Elrharbi-Fleury (Robinhola)
Audrey Rayé (Adrey06)
Philémon Hullot (DesbyP)
Aymeric Collange (aym7)
Clément Guyomard (Clement0)
Closes#3529Closes#5241
In Vim,
:echo system('cat - &', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).
In Nvim,
:echo system('cat - &', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.
This still works:
:%w !tee > foo1358.txt &
but this does not:
:%w !tee foo1358.txt &
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
These tests are essentially affirming a regression vs Vim. In Vim,
:echo system('cat - &', 'foo')
returns "foo", because Vim internally wraps the command with shell-specific
syntax to redirect the streams from /dev/null[1].
That can't work in Nvim because we use pipes directly (instead of temp files)
and don't wrap the command with shell-specific redirection syntax.
References #3529
References #5241
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
`deprecated.txt` is a place for deprecated tags to live.
- Encourages aggressive documentation of deprecations without cluttering
the main help files.
- Provides a single browsable reference of all deprecations.
Other changes:
- Move tags to doc/vim_diff.txt.
- Remove doc/quotes.txt. It has little historical value, except maybe the
Larry Wall quote.
To healthcheck the "foo" plugin:
:CheckHealth foo
To healthcheck the "foo" and "bar" plugins:
:CheckHealth foo bar
To run all auto-discovered healthchecks:
:CheckHealth