aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui/input.c
Commit message (Collapse)AuthorAge
* tui/input: remove "cancel paste" logic which should be redundantBjörn Linse2019-08-31
|
* events: loop_schedule() is unclear, rename it loop_schedule_fast()Björn Linse2019-08-31
|
* tui/input: defer nvim_paste properly.Björn Linse2019-08-31
| | | | | | | | | Otherwise cursor and redraw code for normal and insert mode will not run. The "tickle" workaround was used for this instead, and can now be removed. The builtin vim.lua got the name [string "-- Nvim-Lua stdlib: thevimmodule (:help l..."] in error messages. Fix it to something reasonable.
* API: nvim_paste: add `crlf` parameterJustin M. Keyes2019-08-30
|
* paste: handle vim.paste() failureJustin M. Keyes2019-08-27
| | | | | | | | - Show error only once per "paste stream". - Drain remaining chunks until phase=3. - Lay groundwork for "cancel". - Constrain semantics of "cancel" to mean "client must stop"; it is unrelated to presence of error(s).
* paste: implement redo (AKA dot-repeat)Justin M. Keyes2019-08-27
| | | | | | - Normal-mode redo idiom(?): prepend "i" and append ESC. - Insert-mode only needs AppendToRedobuffLit(). - Cmdline-mode: only paste the first line.
* API: nvim_pasteJustin M. Keyes2019-08-27
|
* paste: phases, dotsJustin M. Keyes2019-08-27
| | | | | | - Send `phase` parameter to the paste handler. - Redraw at intervals and when paste terminates. - Show "..." throbber during paste to indicate activity.
* paste: edge-case: handle EOL at end-of-bufferJustin M. Keyes2019-08-27
| | | | This is "readfile()-style", see also ":help channel-lines".
* paste: use nvim_put()Justin M. Keyes2019-08-27
|
* paste: abort paste if handler does not return trueJustin M. Keyes2019-08-27
|
* TUI/paste: always flush on paste mode-changeJustin M. Keyes2019-08-27
| | | | | | Flush input before entering, not only when leaving, paste mode. Else there could be pending input which will erroneously be sent to the paste handler.
* TUI/paste: define paste function as Lua builtinJustin M. Keyes2019-08-27
| | | | | | | - Define in Lua so that it is compiled-in (available with `-u NONE`). TODO: Eventually we will want a 'pastefunc' option or some other way to override the default paste handler.
* TUI/paste: push bytes directly (avoid libtermkey)Justin M. Keyes2019-08-27
|
* TUI/paste: collect data, invoke user callback #4448ZyX2019-08-27
|
* paste: WIP #4448Justin M. Keyes2019-08-27
|
* tui: support rgba background detection (#10205)Harm te Hennepe2019-06-13
| | | Fixes https://github.com/neovim/neovim/issues/10159.
* 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
* Merge #9829 'startup: remove TUI init special-case'Justin M. Keyes2019-06-04
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #7967 fixes #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 (#9024 c236e80cf3df). 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()`.
| * [skip appveyor] Fix clint issueerw72019-06-04
| |
| * tui/input.c: Fix problem when stdin is not TTYerw72019-06-04
|/
* win: stream_init() issue with tty on Windows #9884erw72019-04-28
| | | ref #9825
* tui/input.c: rename functionsJustin M. Keyes2019-03-25
| | | | | | | | - Rename the module prefix to "tinput_" instead of "term_input". - Some of the private functions were confusing, for example enqueue_input() calls input_enqueue() in another module. - It is helpful for discussion, documentation, and stacktraces if functions (even private) are globally unique.
* autocmd: rename: "++nested", "++once"Justin M. Keyes2019-03-14
| | | | | Based on feedback from upstream: https://github.com/vim/vim/pull/4100
* TUI/background detection: hook into VimEnter eventJustin M. Keyes2019-03-11
| | | | | | | | | | | If terminal response is received during startup, set 'background' from a nested "one-shot" (once) VimEnter autocmd. The previous not-so-clever "self-rescheduling" approach could cause a long delay at startup (event-loop does not make forward progress). fixes #9675 ref #9509
* TUI: rework background-color detectionJustin M. Keyes2019-02-22
| | | | | | | | | - Like Vim, use set_option_value() followed by reset_option_was_set(). - Do not use set_string_default(), so the default is predictable. This affects `:set bg&`. - Wait until end-of-startup (VimEnter) to handle the response. The response is racey anyways, so timing is irrelevant. This allows OptionSet to be triggered, unlike during startup.
* Merge #5027 'TUI: detect background color'Justin M. Keyes2019-01-17
|\
| * Automatically detect terminal background and set bg=dark or bg=lightJosh Triplett2016-07-24
| | | | | | | | | | | | | | | | xterm-compatible terminals support reporting their configured colors back to the application. Use this to obtain the current background color, compute its luminance to classify it as light or dark, and set 'bg' accordingly. Also set the default for 'bg', so that `:set bg&` will revert to that detected default.
* | build: enable -WshadowJustin M. Keyes2019-01-02
| | | | | | | | | | | | | | | | | | | | 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.
* | tui/input.c: add support for mouse release events in urxvt (#8309)symphorien2018-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some terminals don't report which buttons are involved in some mouse events. For example, the urxvt protocol (http://www.huge-man-linux.net/man7/urxvt.html section "Mouse reporting") does not report which button has been released. In this case libtermkey reports button 0 (http://www.leonerd.org.uk/code/libtermkey/doc/termkey_interpret_mouse.3.html) Up to now, forward_mouse_event did not handle button==0. On press events there is not much we can do, and we keep the current behavior which is dropping the event. But on drag-and-release events we can compensate by remembering the last button pressed. fixes #3182 for urxvt fixes #5400
* | Fix for lintGeorge Zhao2018-01-19
| |
* | Fix bug, use &loop->uv replace loop.George Zhao2018-01-18
| |
* | Fix warning about conversion on mingw64George Zhao2018-01-18
| |
* | Merge #7593 'PVS static analysis fixes'Justin M. Keyes2017-11-22
|\ \
| * | input.c: replace if/else with switchPeter Kalauskas2017-11-22
|/ /
* | tui: 'guicursor': use DECSCUSR for xterm-likes (#7576)Justin M. Keyes2017-11-17
| | | | | | | | | | | | | | Anything claiming to be an xterm gets DECSCUSR. This is the only reasonable choice unless/until we get more reliable detection (#7490). ref #6997 closes #7550
* | eventloop: FocusGained: schedule event instead of pseudokeyJustin M. Keyes2017-09-05
| | | | | | | | | | closes #4840 closes #6164
* | win: Terminal UI #6315Rui Abreu Ferreira2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For CI builds unibilium is provided through msys2 packages, and libtermkey is built from source in third-party from equalsraf/libtermkey. In Windows we cannot read terminal input from the stdin file descriptor, instead use libuv's uv_tty API. It should handle key input and encoding. The UI suspend is not implemented for Windows, because the SIGSTP/SIGCONT do not exist in windows. Currently this is a NOOP. Closes #3902 Closes #6640
* | event: Remove "priority" concept.Justin M. Keyes2017-04-28
| | | | | | | | It was replaced by the "child queue" concept (MultiQueue).
* | tui/input.c: Use default 'ttimeoutlen' if option get fails.Justin M. Keyes2017-04-23
| | | | | | | | | | | | Should never happen, but better to be explicit. Helped-by: oni-link <knil.ino@gmail.com>
* | api_clear_error()Justin M. Keyes2017-04-23
| |
* | api: Do not truncate errors <1 MB. #6237Sander Bosma2017-04-23
| | | | | | | | Closes #5984
* | *: Add comment to all C filesZyX2017-04-19
| |
* | 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
* | tui: "backpressure": Drop messages to avoid flooding.Justin M. Keyes2016-12-09
| | | | | | | | | | | | | | | | | | Closes #1234 multiqueue: - Implement multiqueue_size() - Rename MultiQueueItem.parent to MultiQueueItem.parent_item, to avoid confusion with MultiQueue.parent.
* | encoding: cleanup mbyte.c given fixed encoding=utf-8Björn Linse2016-11-05
| | | | | | | | | | | | | | | | | | Eliminate mb_init(): Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like". init_chartab() and screenalloc() are already invoked elsewhere in the initialization process. The EncodingChanged autocmd cannot be triggered. At initialization, there is no spellfiles to reload
* | 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
* | api: consistently use nvim_ prefix and update documentationBjörn Linse2016-08-31
| |
* | stream: set data together with callbackBjörn Linse2016-08-20
|/