Fixes 2 failing tests in startup_spec.lua.
The Windows-only `--literal` option complicates support of "stdin-as-text
+ file-args" (#7679). Could work around it, but it's not worth
the trouble:
- users have a reasonable (and englightening) alternative: nvim +"n *"
- "always literal" is more consistent/predictable
- avoids platform-specific special-case
Unrelated changes:
- Replace fileno(stdxx) with STDXX_FILENO for consistency (not motivated
by any observed technical reason).
silent-mode (-es/-Es) has been broken for years. The workaround up to
now was to include --headless. But --headless is not equivalent because
it prints all messages, not the limited subset defined by silent-mode.
Treat stdin as text by default (so the "-" file is not needed):
echo foo | nvim
It works with file args (implemented in next commit), too:
echo foo | nvim file1.txt file2.txt
Why? Because:
- Execution of input is (1) almost always unintentional/confusing,
and (2) potentially destructive.
- Avoids the need for time-delayed warning. #7659
- The _common_ case is to open text in a buffer, not send commands.
Note:
- Not for Ex-mode (-es) because it is used by scripts. But maybe `-Es`?
- Not for --headless, because stdio may be a protocol stream and may be
used for any purpose by stdioopen().
To treat stdin as Normal-mode commands, use `-s -` instead:
echo ifoo | nvim -s -
Other alternatives:
- Replay a register. E.g. the following mostly works, except @q aborts
on any "beep" (e.g. if the cursor can't move).
nvim -c '%d q|norm @q' -
- Future: Let `:%source` work with unsaved buffer contents?
closes#2087closes#7659
mkfifo (msysgit) does not work outside of msys2 environment.
gzip tests fail on Windows.
mklink requires admin privs for file symbolic links so mklink fails.
`cat` is distributed with neovim, so when can use it everywhere, as
opposed to `sort`.
The diffget test fails for unknown reasons on appveyor, mark it pending
for now.
likely fixes#7768#7913
If multiple internal stream callbacks were recieved before vimL
callbacks got called, only invoke one vimL callback with all data.
Problem: No autocmd triggered in Insert mode with visible popup menu.
Solution: Add TextChangedP. (Prabir Shrestha, Christian Brabandt,
closesvim/vim#2372, closesvim/vim#1691)
Fix that the TextChanged autocommands are not always triggered
when sourcing a script.
5a09343719
- Return VimL errors instead of generic errors for:
- nvim_call_function
- nvim_call_dict_function
- Fix tests which were silently broken before this change.
This violates #6150 where we agreed not to translate API errors. But
that can be fixed later.
The `internal` param is difficult to explain, and will rarely be
anything but `true`. To avoid it, use a hack: check if the resolved
dict value starts with "function(".
Make `:verbose set ...` show when an option was last modified by an
API client or Lua script/chunk. In the case of an API client, the
channel ID is displayed.
Avoid a hot loop in retry(), there's no need to retry more than 50/s.
Also use luv.sleep() to implement sleep() instead of spinning the
event-loop, so events are not silently discarded.
1. Don't check elapsed time in children_kill_cb(), it's already implied
by the start-time of the timer itself.
2. Restart timer from children_kill_cb() for PTY jobs, to send SIGKILL
after SIGTERM. There is an edge case where SIGKILL might follow
SIGTERM too quickly, if jobstop() is called near the 2-second timer
window. But this edge case is not worth code complication.
I failed to deduce why analyzer thinks E882 may not be triggered, though
conditions for triggering it are strange: it would trigger E882 only in the
single case “function returned non-number”. Cases “function thrown exception”,
or “built-in sorter encountered error” will neither yield E882 nor stop
sort()/uniq().
Note though that searching test code revealed that neither E702 nor E882 are not
tested anywhere.
* Reading from stdin on Windows is fixed in the same way as it was in
#8267.
* The file_read function was returning without filling the
destination buffer when it was called with a non-blocking file
descriptor.
Problems:
- In two places in shada_read_when_writing() memory just was not freed. Both
places were verified to cause test failures.
- Numbered marks got assigned incorrect (off-by-one compared to position in the
array) numbers in replace_numbered_mark.
- It was possible to have non-continuously populated array of numbered marks
which messed up code for merging them.
(Note about tests: marks with additional data are always compared different when
merging, that caused some confusion regarding why test did not work the way
I expected.)