fixes#7967fixes#9959
Historically Vim/Nvim does backflips to handle input and show messages
before a UI is available. This logical contradiction was already fixed
for remote UIs (#9024c236e80cf3). Fixing it also for the TUI avoids
problems on Windows, simplifies the logic, and avoids races like #9959.
- Move ui_builtin_start() to the same position as embedded_mode
remote_ui_wait_for_attach().
- If stdin is redirected, save the original `stdin` and replace fd
0 with tty before calling `ui_builtin_start()`.
Problem: Asking about existing swap file unnecessarily.
Solution: When it is safe, delete the swap file. Remove
HAS_SWAP_EXISTS_ACTION, it is always defined. (closesvim/vim#1237)
67cf86bfff
N/A:
vim-patch:8.1.1232
vim-patch:8.1.1233
vim-patch:8.1.1236
Nvim notes:
- Nvim does not support "-u DEFAULTS", that change is omitted.
- Also add 'shadafile' as an alias to 'viminfofile'.
- Deprecate 'viminfofile'.
Problem: Not easy to start Vim cleanly without changing the viminfo file.
Not possible to know whether the -i command line flag was used.
Solution: Add the --clean command line argument. Add the 'viminfofile'
option. Add "-u DEFAULTS".
c4da113ef9
- input: recognize <kEqual>, <kComma>
- terminal.c: If we need to support function key, a change must be made
in libvtermkey. Currently, it emulates strictly VT220 terminal, and
returning numeric value in 'normal' mode is the expected behaviour.
closes#9810
The patch is N/A but we include it for consistency.
closes#9814
---
Problem: Checking for ambigous width is not working. (Hirohito Higashi)
Solution: Reset "starting" earlier.
6b1da3312e
- Minimum required libuv is now v1.12
- Because `uv_os_getenv` requires allocating, we must manage a map
(`envmap` in `env.c`) to maintain the old behavior of `os_getenv` .
- free() map-items after removal. khash.h does not make copies of
anything, so even its keys must be memory-managed by the caller.
closes#8398closes#9267
grid_xx functions shouldn't randomly be called when the screen is not valid.
Nvim deterministically initializes a default screen early in main(), so the
default grid can be assumed to be allocated.
Initially we will use this for the popupmenu, floating windows will
follow soon
NB: writedelay + compositor is weird, we need more flexible
redraw introspection.
Note about shada.c:
- shada_read_next_item_start was intentionally shadowing `unpacked` and
`i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly
depended on those variable names.
- Macros were changed to parameterize `unpacked` (but not `i`). Macros
like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other
approach is messy.
Namespaces is a lightweight concept that should be used to group
objects for purposes of bulk operations and introspection. This is
initially used for highlights and virtual text in buffers, and is
planned to also be used for extended marks. There is no plan use them
for privileges or isolation, neither to introduce nanespace-level
options.
Give embeders a chance to set up nvim, by processing a request before
startup. This allows an external UI to show messages and prompts from
--cmd and buffer loading (e.g. swap files)
loop_schedule_deferred may leak its allocated Event if the Event does
not get processed (when Nvim exits).
It only happens on exit, so we tried to ignore it in .asan-blacklist,
but for that isn't working for unknown reasons.
= ==22007==ERROR: LeakSanitizer: detected memory leaks
= Direct leak of 88 byte(s) in 1 object(s) allocated from:
= 0 0x4ef7a3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
= 1 0xfcafc1 in try_malloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:88:15
= 2 0xfcb1e9 in xmalloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:122:15
= 3 0xa6e75f in loop_schedule_deferred /home/travis/build/neovim/neovim/build/../src/nvim/event/loop.c:91:19
= 4 0x18ab048 in tui_main /home/travis/build/neovim/neovim/build/../src/nvim/tui/tui.c:377:5
= 5 0x18fe120 in ui_thread_run /home/travis/build/neovim/neovim/build/../src/nvim/ui_bridge.c:102:3
= 6 0x7f09e5e58183 in start_thread /build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312
= SUMMARY: AddressSanitizer: 88 byte(s) leaked in 1 allocation(s).
Problem: MS-Windows users expect -? to work like --help.
Solution: Add -?. (Christian Brabandt, closesvim/vim#2867)
c3e81694fc
Include runtime/ changes from 85eee130f4 to pass 8.1.0231 tests.
Problem: Invalid memory access on exit when autocommands wipe out a buffer.
(gy741, Dominique Pelle)
Solution: Check if the buffer is still valid. (closesvim/vim#2449)
606d45ccd8
Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.
Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.
cmdline uses curwin cursor position when ext_cmdline is active.
DWIM: avoid empty buffer 1 when stdin was empty. If other files were
specified at startup, we assume that stdin is only accidentally
not-a-TTY: user did not intend to send text from it.
ref #8560
ref #8561
If stdin is not a TTY we read it into buffer 1, as text. But if the
stdin pipe is empty, Nvim was most likely invoked for some other reason.
DWIM: select buffer 2 (if it exists). Example:
echo file1 | xargs nvim
closes#8560closes#8561
ref https://github.com/equalsraf/neovim-qt/issues/417
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands.
It should always read stdin as text (into buffer 1), like this:
echo foo | nvim -Es +'%p'
foo
echo foo | nvim -Es -u NORC +'%p'
foo
This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E). That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).
Before this change:
* the screen test hangs.
After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.
This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)
ref #1089 :-)~