aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui/input.c
Commit message (Collapse)AuthorAge
...
* feat(ui_client): implement async paste handlingbfredl2022-03-17
|
* feat(ui_client): pass user input to remote serverhlpr982022-03-17
|
* chore: fix typos (#17670)dundargoc2022-03-17
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* chore: fix typos (#17250)dundargoc2022-02-08
| | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com> Co-authored-by: Axel Dahlberg <git@valleymnt.com>
* vim-patch:8.2.4241: some type casts are redundantDundar Göc2022-01-30
| | | | | | | | Problem: Some type casts are redundant. Solution: Remove the type casts. (closes vim/vim#9643) https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27 This is not a literal port but an equivalent one.
* fix(tui): end streamed paste correctly when key buffer is emptyzeertzjq2021-12-10
|
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor: format tui/input.c with uncrustify (#15661)dundargoc2021-09-14
|
* tui: fix possibility of evaluating uninitialized variables (#13987)erw72021-02-22
|
* Use abort() instead of assert(false) for things that should never happenJames McCoy2021-01-31
| | | | | | | | assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
* test,unit: Change test according to change of bg color response processingerw72020-11-20
| | | | | Adjust the test for handle_background_color() according to bd0275182b1c1b14c43dc4fc7e9f9da05071e56c.
* TUI: fix processing of bg color responseerw72020-11-20
| | | | | | | | Terminal responses may be fragmented. In that case, the problem that was not processed normally and was processed in the same way as user input is corrected. fixes #11393.
* TUI: fix bracket paste getting stuckerw72020-11-20
| | | | fixes #11699, #11991.
* tui/input: Add S- modifier for chords with capital ASCIIJames McCoy2020-11-16
| | | | | | | | termkey_strfkey() formats ctrl-l and ctrl-shift-l as <C-l> and <C-L>, respectively. Nvim wants the latter to look like <C-S-L>, since <C-l> and <C-L> are interpreted the same way. This is only required when the Ctrl modifier is present.
* Understand Escape as another name for EscJames McCoy2020-11-16
| | | | | | | | This allows us to remove special-case handling of Esc in forward_modified_utf8(), which was always sending "<Esc>" to nvim even when there were modifiers present. Closes #12584
* TUI: do not use "nvim_get_option" in tui threaderw72020-03-21
| | | | | | Since "nvim_get_option" is executed on the tui thread as a C function instead of msgpack-rpc, it accesses global variables that may change on the main thread.
* Add stdin, stdout replacement functionserw72020-01-17
|
* TUI: use stdio names instead of magic numbers #11410erw72019-11-17
|
* tui: fix handling of bg response after suspend (#11145)Daniel Hahler2019-10-03
| | | | | | | | | | | | | | | | `tui_terminal_after_startup` gets called right after resuming from suspending (via `Ctrl-z`) already (not delayed as with the startup itself), and would set `waiting_for_bg_response` to false then directly. This results in the terminal response not being processed then anymore, and leaking into Neovim itself. This changes it to try 5 times always, which means that it typically would stop after a few characters of input from the user typically, e.g. with tmux, which does not send a reply. While it might be better to have something based on the time (e.g. only wait for max 1s), this appears to be easier to do. Fixes regression in 8a4ae3d.
* tui: improve handle_background_color: short-circuit (#11067)Daniel Hahler2019-09-30
| | | | | | | | * handle_background_color: short-circuit if handled already * Unit tests for handle_background_color * set waiting_for_bg_response to false in tui_terminal_after_startup By then it should have been received.
* 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.