aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
Commit message (Collapse)AuthorAge
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* state: throttle batched event processing when input is availableBjörn Linse2021-03-08
| | | | | | | 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.
* input: consider "-- more --" state to be blocking, fixes #11899Björn Linse2021-01-04
|
* [squash] fix comment [skip ci]erw72020-05-26
|
* input: fix stack overflowerw72020-05-25
| | | | fixes #12287, #11788
* refactor: allow us to process a child queue only while waiting on inputBjörn Linse2019-09-08
|
* paste: WIP #4448Justin M. Keyes2019-08-27
|
* refactor: use int for Columns and RowsBjörn Linse2019-07-19
|
* TUI: set os/input.c:global_fd to input->in_fd #10174erw72019-06-10
| | | | | | | | | | | | | 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
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* ui: multigrid mouse supportBjörn Linse2019-01-20
|
* log: RPC, input, other eventsJustin M. Keyes2018-09-19
|
* cleanup, test interactive -EJustin M. Keyes2018-06-04
|
* win/startup: remove --literalJustin M. Keyes2018-06-04
| | | | | | | | | | | | | | | 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).
* startup: allow explicit "-" file arg with --headlessJustin M. Keyes2018-06-04
|
* startup: fix -es/-Es so they are actually silentJustin M. Keyes2018-06-04
| | | | | | 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.
* lintJustin M. Keyes2018-06-04
|
* os/input.c: parse keycodes in non-string context #7411lePerdu2018-01-18
| | | | | | | | | | | 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
* input: only change mode of input fd if there is an input fdBjörn Linse2017-11-25
|
* api/nvim_get_mode: Use child-queue instead of "priority".Justin M. Keyes2017-04-28
|
* input.c: Process only safe events before blocking.Justin M. Keyes2017-04-28
| | | | | Introduce multiqueue_process_priority() to process only events at or above a certain priority.
* api: nvim_get_mode()Justin M. Keyes2017-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge #6550 from ZyX-I/pvs-check-commentJustin M. Keyes2017-04-20
|\
| * *: Add comment to all C filesZyX2017-04-19
| |
* | vim-patch:7.4.2209James McCoy2017-04-19
|/ | | | | | | | 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
* vim-patch:8.0.0275Justin M. Keyes2017-02-06
| | | | | | | | 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
* input_enqueue(): Fix length calculation. (#5981)Justin M. Keyes2017-01-20
| | | Ref: https://github.com/neovim/neovim/issues/5885#issuecomment-273614373
* tui: check stty/termios for kbsJustin M. Keyes2016-12-23
| | | | | | | | | | | 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
* event/multiqueue.c: Rename "queue" to "multiqueue".Justin M. Keyes2016-10-02
| | | | | | | | | | | | | | `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).
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | 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
* stream: set data together with callbackBjörn Linse2016-08-20
|
* lintsach1t2016-08-07
|
* input.c: restore double clicksach1t2016-08-07
|
* *: Rename main loop variable from loop to main_loopZyX2016-05-30
| | | | | | | | | | | | | | | | 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.
* *: Fix new linter errorsZyX2016-05-01
| | | | 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.
* keymap: Make replace_termcodes and friends accept length and cpo_flagsZyX2016-04-18
| | | | | | | 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.
* vim-patch:7.4.936 #4271watiko2016-02-22
| | | | | | | | | | | | | | | 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/573Shougo Matsushita2016-01-13
| | | | | | | | | | | | | | | | | 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
* os/input.c: Fix assertion in `create_cursorhold_event`Thiago de Arruda2015-10-29
| | | | The assertion now considers the case where events are disabled.
* main: Refactor normal_enter to call `os_inchar` directlyThiago de Arruda2015-10-26
| | | | | | | | | 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.
* input: Remove CURSORHOLD keyThiago de Arruda2015-10-26
| | | | | | | | | | | 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.
* os/input: Don't advance past incomplete sequences in input_enqueueThiago de Arruda2015-10-01
| | | | | This allows callers to incrementally process buffers that are filled by incomplete chunks more easily.
* rstream: Pass read count to read eventsThiago de Arruda2015-08-13
| | | | This is necessary to keep events in the same order received from the OS.
* event: Refactor async event processingThiago de Arruda2015-08-13
| | | | | | | | | | - 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.
* loop: Simplify loop.c and move some code to input.cThiago de Arruda2015-08-13
| | | | | | - Declare poll timer in Loop structure instead of a loop_poll_events local variable. - Move deferred event management to input.c
* rstream/wstream: Unify structures and simplify APIThiago de Arruda2015-07-17
| | | | | | | | | | | | | - 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.
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - 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.
* rbuffer: Reimplement as a ring buffer and decouple from rstreamThiago de Arruda2015-07-01
| | | | | | | | | | | | | | | | | | | | 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>
* input: rename input_{start,stop}_stdin()Justin M. Keyes2015-05-27
| | | | | - "stdin" is misleading because it may read from stdout or stderr - also remove some unused includes
* input: stream_set_blocking(): libuv implJustin M. Keyes2015-05-27
| | | | | | | | | - 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.