| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
before, calling vim.schedule() from inside an event would execute
the scheduled callback immediately after this event without
checking for user input in between. Break event processing
whenever user input or an interrupt is available.
|
| |
|
| |
|
|
|
|
| |
fixes #12287, #11788
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: When we changed startup to wait for the TUI (like a remote UI),
we forgot to set os/input.c:global_fd. That used to be done by
input_start().
Solution: Initialize os/input.c:global_fd before initializing libtermkey
(termkey_new_abstract) so that tui_get_stty_erase() and
friends can inspect the correct fd.
fixes #10134
close #10174
|
|
|
|
| |
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
cb02137dfac7 had two mistakes, of the same nature: trans_special() must
be invoked with in_string=false unless the parsing context is a VimL
string. replace_termcodes() and input_enqueue() are low-level
mechanisms where VimL strings do not exist.
keymap.c: adjust double-quote case to satisfy keymap_spec.lua
closes #7410
|
| |
|
| |
|
|
|
|
|
| |
Introduce multiqueue_process_priority() to process only events at or
above a certain priority.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Asynchronous API functions are served immediately, which means pending
input could change the state of Nvim shortly after an async API function
result is returned.
nvim_get_mode() is different:
- If RPCs are known to be blocked, it responds immediately (without
flushing the input/event queue)
- else it is handled just-in-time before waiting for input, after
pending input was processed. This makes the result more reliable
(but not perfect).
Internally this is handled as a special case, but _semantically_ nothing
has changed: API users never know when input flushes, so this internal
special-case doesn't violate that. As far as API users are concerned,
nvim_get_mode() is just another asynchronous API function.
In all cases nvim_get_mode() never blocks for more than the time it
takes to flush the input/event queue (~µs).
Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if
e.g. `d` is operator-pending.
Closes #6159
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
| |
Problem: Cannot map <M-">. (Stephen Riehm)
Solution: Solve the memory access problem in another way. (Dominique Pelle)
Allow for using <M-\"> in a string.
https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
|
|
|
|
|
|
|
|
| |
Problem: When checking for CTRL-C typed the GUI may detect a screen resize
and redraw the screen, causing trouble.
Solution: Set updating_screen in ui_breakcheck().
https://github.com/vim/vim/commit/e3caa1109072b9655f8d5103c92efd73177f8577
|
|
|
| |
Ref: https://github.com/neovim/neovim/issues/5885#issuecomment-273614373
|
|
|
|
|
|
|
|
|
|
|
| |
Requires libtermkey 0.19+
Closes #2048
Closes #5693
See https://github.com/neovim/libtermkey/compare/a9b61424aae9f7548162ff112393c5f706cf54f1%5E...c0eb4e4a05f49ad8fee0195c77f2c29d09cc36af
See https://bugzilla.redhat.com/show_bug.cgi?id=142659
See https://github.com/tmux/tmux/blob/fe4e9470bb504357d073320f5d305b22663ee3fd/tty-keys.c#L625-L632
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.
Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.
Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
|
|
|
|
|
|
|
|
|
|
| |
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
|
|
|
| |
Originally there were 128 new errors, so I thought this is a good idea to fix
all of them. Of course, this commit also fixes many suppressed errors.
|
|
|
|
|
|
|
| |
Reasons:
- One does not have to do `s[len] = NUL` to work with these functions if they do
not need to replace the whole string: thus `s` may be const.
- One does not have to save/restore p_cpo to work with them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Crash when dragging with the mouse.
Solution: Add safety check for NULL pointer. Check mouse position for valid
value. (Hirohito Higashi)
https://github.com/vim/vim/commit/294a7e55b01149154807a23323038784549b8946
---
see: "Crash while mouse-selecting in two-buffer mode"
https://github.com/vim/vim/issues/486
Fix #3704
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
https://github.com/vim/vim/commit/651863c94a882a97aec7968fc87a638ff78e56ff
Problem: Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution: Call get_real_state() instead of using State directly.
https://github.com/vim/vim/commit/5000869712f799d9ca25c0e45dc21d332edae5f4
|
|
|
|
| |
The assertion now considers the case where events are disabled.
|
|
|
|
|
|
|
|
|
| |
This makes it impossible for K_EVENT to interfere with mappings, but it also
disables processing of events while in the middle of a mapping (Though this will
be fixed later as this refactoring progresses).
`may_sync_undo` is now called when K_EVENT is received. This is necessary to
correctly update undo entry lists before executing some action.
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor input.c, normal.c and edit.c to use the K_EVENT special key to trigger
the CURSORHOLD event. In normal and edit mode, K_EVENT is treated as
K_CURSORHOLD, which enables better handling of arbitrary actions in those
states(eg: In normal mode the previous operator counts will be restored).
Also fix a test in vim_spec.lua. The test had a wrong assumption: cmdheight is
only used to determine when the press enter screen will be shown, not to limit
how many lines or control pagination.
|
|
|
|
|
| |
This allows callers to incrementally process buffers that are filled by
incomplete chunks more easily.
|
|
|
|
| |
This is necessary to keep events in the same order received from the OS.
|
|
|
|
|
|
|
|
|
|
| |
- Improve the implementation of deferred/immediate events.
- Use the new queue module to change how/when events are queued/processed by
giving a private queue to each emitter.
- Immediate events(which only exist to break uv_run recursion) are now
represented in the `loop->fast_events` queue.
- Events pushed to child queues are propagated to the event loop main queue and
processed as K_EVENT keys.
|
|
|
|
|
|
| |
- Declare poll timer in Loop structure instead of a loop_poll_events local
variable.
- Move deferred event management to input.c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Simplify RStream/WStream API and make it more consistent with libuv.
- Move into the event loop layer(event subdirectory)
- Remove uv_helpers module.
- Simplify job/process internal modules/API.
- Unify RStream and WStream into a single structure. This is necessary because
libuv streams can be readable and writable at the same time(and because the
uv_helpers.c hack to associate multiple streams with libuv handle was removed)
- Make struct definition public, allowing more flexible/simple memory
management by users of the module.
- Adapt channel/job modules to cope with the changes.
|
|
|
|
|
|
|
|
|
|
| |
- Add event loop abstraction module under src/nvim/event. The
src/nvim/event/loop module replaces src/nvim/os/event
- Remove direct dependency on libuv signal/timer API and use the new abstraction
instead.
- Replace all references to uv_default_loop() by &loop.uv, a new global variable
that wraps libuv main event loop but allows the event loop functions to be
reused in other contexts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract the RBuffer class from rstream.c and reimplement it as a ring buffer,
a more efficient version that doesn't need to relocate memory.
The old rbuffer_read/rbuffer_write interfaces are kept for simple
reading/writing, and the RBUFFER_UNTIL_{FULL,EMPTY} macros are introduced to
hide wrapping logic when more control is required(such as passing the buffer
pointer to a library function that writes directly to the pointer)
Also add a basic infrastructure for writing helper C files that are only
compiled in the unit test library, and use this to write unit tests for RBuffer
which contains some macros that can't be accessed directly by luajit.
Helped-by: oni-link <knil.ino@gmail.com>
Reviewed-by: oni-link <knil.ino@gmail.com>
Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Michael Reed <m.reed@mykolab.com>
|
|
|
|
|
| |
- "stdin" is misleading because it may read from stdout or stderr
- also remove some unused includes
|
|
|
|
|
|
|
|
|
| |
- Create a private libuv loop instead of re-using uv_default_loop(), to
avoid conflict[1] with existing watcher(s) on the fd.
- Expose the global "input" fd as a getter instead of a mutable global.
[1] .deps/build/src/libuv/src/unix/core.c:833:
uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
|