aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui
Commit message (Collapse)AuthorAge
...
* tui: simplify branching of rgb vs cterm colorsBjörn Linse2019-11-02
|
* TUI/thread: guard env map from potential race with unibilium #11259erw72019-10-20
| | | unibi_from_term calls getenv internally, so exclusive control is required.
* 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.
* patch_terminfo_bugs: TERM=xterm with non-xterm: ignore smglr (#11132)Daniel Hahler2019-10-02
| | | | | | | | | "smglr" was added for TERM=xterm recently to the terminfo database, which causes display issues with terminals that use `TERM=xterm` by default for themselves, although not supporting it. This patch makes "smglr" to be ignored then. Fixes https://github.com/neovim/neovim/issues/10562
* 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.
* terminfo_start: keep first flushing of ui buffer (#11118)Daniel Hahler2019-09-29
| | | | | | | | Initially done in 3626d2107 (#11074, for #11062), it was reverted then in 445f2f409 (#11083, which added flushing later). But it is still required here to avoid the reporting of the background response with urxvt/kitty (`nvim -u NONE -cq`). Apparently I've tested this not enough with 445f2f409 (probably only within tmux).
* tui: flush ui buffer in tui_terminal_after_startup (#11083)Daniel Hahler2019-09-24
| | | | | | | | | | | | | | This avoids having a dummy event to tickle the main loop. Confirmed using `nvim -u NONE -c 'au FocusGained * q'` in tmux (with `:set -g focus-events on`): without the flushing it would only exit after pressing a key. Moves the flushing done recently in 3626d2107. `nvim -u NONE -cq` is still working (i.e. consuming the response for the terminal background query itself), and the flickering mentioned in 3626d2107 is reduced again. Reverts part of bfb21f3e0 (#7729).
* terminfo_start: flush buffer #11074Daniel Hahler2019-09-22
| | | | | | | | | | | | | | | | This aligns with `terminfo_stop`, which also flushes the buffer after disabling things. This ensures Neovim gets the response to the terminal background query before exiting (`nvim -u NONE -cq` with e.g. urxvt or kitty). Caveats: * With kitty this causes some "flickering", likely since the alternate screen is being setup with `nvim -u NONE -cq`, whereas it would not be processed otherwise before quitting (as with the background query). * tmux after this patch may print ^[[I (CSI I / FocusGained) after `nvim -u NONE -cq`. Fixes https://github.com/neovim/neovim/issues/11062
* syntax, TUI: support "strikethrough"Jaskaran Singh2019-09-13
| | | | | | fix #3436 Includes: vim-patch:8.0.1038: strike-through text not supported
* 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: tickle cursorJustin M. Keyes2019-08-27
| | | | | | | | | | HACK: The cursor does not get repositioned after the paste completes. Scheduling a dummy event seems to fix it. Test case: 0. Revert this commit. 1. Paste some text in Normal-mode. 2. Notice the cursor is still in the cmdline area.
* 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: handle Smulx extension capability (extended underline) (#9097)Daniel Hahler2019-08-22
| | | | | | | | | This was added to ncurses terminfo for vte and tmux. Ref: https://github.com/tmux/tmux/issues/1492#issuecomment-427675180 Assumes color support is available when extended underline is supported. Ref: https://github.com/tmux/tmux/issues/1492#issuecomment-427803984
* TUI: do not use "starting" global mutated by main threadBjörn Linse2019-08-15
|
* terminfo_start: use unibi_from_term, skip without TERM (#10670)Daniel Hahler2019-08-02
| | | | | This is clearer/more explicit and avoids potential mismatch between what unibilium thinks vs what Nvim thinks. For reference: https://github.com/mauke/unibilium/blob/e3b16d6219ca1cb92d98b1d9cc416b49a3ac468e/uniutil.c#L203-L211
* env: invalid pointer after os_setenv() #10558erw72019-07-23
|
* win/TUI: workaround libuv LF => CRLF conversion #10558erw72019-07-23
| | | | | | Replace cud1 with \x1b[B because \n is CRLF on Windows (due to libuv). fix #9461
* 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
|/
* tui:cursor_goto(): remove dead code #9952Justin M. Keyes2019-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | fix #9918 ref dbc25f5a87cf3bcfe1caac1eb1ff8b3a6978a415 Before 7ede14d191b1 the UGRID_FOREACH_CELL loop was never entered, because it expanded to an always-false condition. From build/src/nvim/auto/tui/tui.i: do { UCell *row_cells = (grid)->cells[grid->row]; for (int col = grid->col; col < col; col++) { UCell *cell = row_cells + col; (void)(cell); { print_cell(ui, cell); }; } } while (0); After 7ede14d191b1 issue #9918 was reported. $ ./build/bin/nvim -Nu NONE +'colo evening' :h<tab> " causes cursor to change colors Since the code was dead before 7ede14d191b1, just remove it.
* 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_tk_ti_getstr: handle weird value #9688Boskovits2019-03-07
| | | | | | | | | tigetstr (used by libtermkey/driver-ti.c) may return -1 as a pointer. Documented in man 3 tigetstr. https://linux.die.net/man/3/tigetstr > The tigetstr routine returns the value (char *)-1 if capname is not a string > capability, or 0 if it is canceled or absent from the terminal description. Fixed #9687
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* TUI: do not resize host-terminal on startup (#9645)Justin M. Keyes2019-02-25
| | | | | | ...unless the 'lines' and/or 'columns' options were set. ref 5732340c2035 fixes #5843
* 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-02-17
|\
| * 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.
* | | TUI: assume italics support in all xterm-likesJustin M. Keyes2019-02-12
| | | | | | | | | | | | | | | | | | https://github.com/neovim/neovim/issues/9598#issuecomment-462421302 > On systems other than macOS, terminfo always has them set. It's part > of the ANSI standard SGR codes
* | | TUI: sniff nsterm (Terminal.app) from $TERM_PROGRAMJustin M. Keyes2019-02-11
| | |