aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
Commit message (Collapse)AuthorAge
...
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* cmdheight=0: fix bugs part2 (#19185)Shougo2022-07-31
|
* perf(ui): avoid ui_flush() work in headless modebfredl2022-07-18
|
* perf(ui): unpack a single ui event at a time, instead of a "redraw" batchbfredl2022-07-18
| | | | | This reduces the memory overhead for large redraw batches, as a much smaller prefix of the api object buffer is used and needs to be hot in cache.
* fix(input): use correct grid when restoring cursor for <expr> mapping (#19047)zeertzjq2022-06-23
|
* perf(ui): remove spurious allocations from mode_style_array()bfredl2022-06-21
|
* perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl2022-06-20
| | | | | | | | | | | | | | | | | Note for external UIs: Nvim can now emit multiple "redraw" event batches before a final "flush" event is received. To retain existing behavior, clients should make sure to update visible state at an explicit "flush" event, not just the end of a "redraw" batch of event. * Get rid of copy_object() blizzard in the auto-generated ui_event layer * Special case "grid_line" by encoding screen state directly to msgpack events with no intermediate API events. * Get rid of the arcane notion of referring to the screen as the "shell" * Array and Dictionary are kvec_t:s, so define them as such. * Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with a predetermined size within an arena. * Eliminate redundant capacity checking when filling such kvec_t:s with values.
* fix(tui): piping nodejs to nvim breaks input handling #18932Kevin Sicong Jiang2022-06-19
| | | | | | | | | | | | | | | | | | | | | | Problem: Piping NodeJS output into Neovim makes the editor unusable. This happens because NodeJS changes the tty state on exit after Nvim calls uv_tty_set_mode(). (May not always happen due to race condition.) This should have been fixed by 4ba5b4a86461 #13084. But some commands and functions (:sleep, system(), …) call ui_flush() internally, in particular the first tui_mode_change() is called before the end of startup. Steps to reproduce: 1. node -e "setTimeout(()=>{console.log('test')}, 1000)" | nvim -u NORC +"sleep 500m" - 2. The cursor key letters just overwrite the editor screen, and CTRL+C exits. Solution: Skip pending_mode_update during startup. Note: Delaying ui_flush() entirely could be a more general solution (emit a new UI event on VimEnter?). But "remote/coprocess TUI" #18375 could make all of this moot anyway. Fixes #18470
* perf(memory): use an arena for RPC decodingbfredl2022-06-14
| | | | | | | | | drawback: tracing memory errors with ASAN is less accurate for arena allocated memory. Therefore, to start with it is being used for Object types around serialization/deserialization exclusively. This is going to have a large impact especially when TUI is refactored as a co-prosess as all UI events will be serialized and deserialized by nvim itself.
* fix(logging): skip recursion, fix crash #18764Justin M. Keyes2022-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. The main log routine does not protect itself against recursion. log_lock() doesn't guard against recursion, it would deadlock... 2. 22b52dd462e5 (#11501) regressed 6f27f5ef91b3 (#10172), because set_init_1..process_spawn tries to log (see backtrace below), but the mutex isn't initialized yet. Even if the mutex were valid, we don't want early logging to fallback to stderr because that can break embedders when stdio is used for RPC. frame 1: 0x00000001001d54f4 nvim`open_log_file at log.c:205:7 frame 2: 0x00000001001d5390 nvim`logmsg(log_level=1, context="UI: ", func_name=0x0000000000000000, line_num=-1, eol=true, fmt="win_viewport") at log.c:150:20 frame : 0x000000010039aea2 nvim`ui_call_win_viewport(grid=2, win=1000, topline=0, botline=1, curline=0, curcol=0, line_count=1) at ui_events_call.generated.h:321:3 frame 4: 0x00000001003dfefc nvim`ui_ext_win_viewport(wp=0x0000000101816400) at window.c:939:5 frame 5: 0x00000001003ec5b4 nvim`win_ui_flush at window.c:7303:7 frame 6: 0x00000001003a04c0 nvim`ui_flush at ui.c:508:3 frame 7: 0x00000001002966ba nvim`do_os_system(argv=0x0000600000c0c000, input=0x0000000000000000, len=0, output=0x0000000000000000, nread=0x00007ff7bfefe830, silent=false, forward_output=false) at shell.c:894:3 frame 8: 0x0000000100295f68 nvim`os_call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_args=0x0000000000000000) at shell.c:663:18 frame 9: 0x0000000100295845 nvim`call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_shell_arg=0x0000000000000000) at shell.c:712:14 frame 10: 0x0000000100294c6f nvim`os_expand_wildcards(num_pat=1, pat=0x00007ff7bfefeb20, num_file=0x00007ff7bfefee58, file=0x00007ff7bfefee60, flags=43) at shell.c:328:7 ... frame 23: 0x000000010028ccef nvim`expand_env_esc(srcp=",~foo", dst="~foo", dstlen=4094, esc=false, one=false, prefix=0x0000000000000000) at env.c:673:17 frame 24: 0x000000010026fdd5 nvim`option_expand(opt_idx=29, val=",~foo") at option.c:1950:3 frame 25: 0x000000010026f129 nvim`set_init_1(clean_arg=false) at option.c:558:19 frame 26: 0x00000001001ea25e nvim`early_init(paramp=0x00007ff7bfeff5f0) at main.c:198:3 frame 27: 0x00000001001ea6bf nvim`main(argc=1, argv=0x00007ff7bfeff848) at main.c:255:3 Solution: 1. Check for recursion, show "internal error" message. - FUTURE: when "remote TUI" is merged, can we remove log_lock()? 2. Skip logging if log_init wasn't called yet.
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* refactor: grid->rows and grid->colsbfredl2022-05-18
|
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)zeertzjq2022-05-10
| | | | | | | | Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first. https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435 A hunk from the patch depends on patch 8.2.4861, which hasn't been ported yet, but that should be easy to notice.
* refactor(uncrustify): change rules to better align with the style guideDundar Goc2022-04-29
| | | | | | | | | | | | | Add space around arithmetic operators '+' and '-'. Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. Remove space between '((' or '))' of control statements. Add space between ')' and '{' of control statements. Remove space between function name and '(' on function declaration. Collapse empty blocks between '{' and '}'. Remove newline at the end of the file. Remove newline between 'enum' and '{'. Remove newline between '}' and ')' in a function invocation. Remove newline between '}' and 'while' of 'do' statement.
* refactor(uncrustify): format all c code under /src/nvim/Dundar Goc2022-04-29
|
* refactor(ui_refresh): only save/restore p_lz if calling screen_resize() (#17794)zeertzjq2022-03-23
|
* feat(ui_client): handle resize eventshlpr982022-03-17
|
* refactor: remove redundant castsDundar Göc2022-03-06
|
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* refactor(misc1): move way beep functions elsewhereBjörn Linse2021-12-10
|
* refactor: format with uncrustify #15872dundargoc2021-10-02
| | | | * refactor: format with uncrustify * refactor: fix function parameter comments
* fix(ui): don't log from UI events during free_all_mem()Björn Linse2021-09-14
| | | | | | | | | | | | | | Example assertion failure: %0 in logmsg neovim/src/nvim/log.c:139:17 %1 in ui_call_update_menu neovim/build/src/nvim/auto/ui_events_call.generated.h:8:3 %2 in ex_menu neovim/src/nvim/menu.c:263:3 %3 in do_one_cmd neovim/src/nvim/ex_docmd.c:1981:5 %4 in do_cmdline neovim/src/nvim/ex_docmd.c:602:20 %5 in do_cmdline_cmd neovim/src/nvim/ex_docmd.c:287:10 %6 in free_all_mem neovim/src/nvim/memory.c:596:3 %7 in os_exit neovim/src/nvim/main.c:574:3 %8 in exit_event neovim/src/nvim/msgpack_rpc/channel.c:569:5
* screen: setup scrolling main screen when starting with display-=msgsepBjörn Linse2021-03-23
|
* ui: make 'mouse' handling in external UI more consistentBjörn Linse2021-01-01
| | | | | | | | | before the behaviour of 'mouse' was inconsistent in external UI, as some remapping logic would check has_mouse() and others don't (no difference in TUI or vim classic). With this change, the behaviour is consistently up to the UI decide (see ui.txt edit) Behaviour of tui.c is unaffected by this change.
* api/ui: simplify popup menu position get/set logic; fix testYatao Li2020-04-28
|
* api/ui: allow set bounds row and col to be less than 0; ui_pum_get_pos: ↵Yatao Li2020-04-28
| | | | return first extui bounds information instead of reducing
* external pum: use floating point geometry; typval: add tv_dict_add_floatYatao Li2020-04-28
|
* ui_pum_get_pos: return internal pum position if external pum pos not foundYatao Li2020-04-28
|
* API/UI: Allow UI to set PUM position and size, and pass the position to ↵Yatao Li2020-04-28
| | | | CompleteChanged
* api/ui: win_viewport event for visible range and cursor position in windowBjörn Linse2020-04-01
|
* ui_grid_resize: fix resize logic for floating window #11655Ville Hakulinen2020-01-06
|
* rename: UIAttach/UIDetach => UIEnter/UILeaveJustin M. Keyes2019-09-12
| | | | | "enter"/"leave" is more conventional for Vim events, and "attach"/"detach" distinction does not gain much.
* API/nvim_list_uis(): include "chan" field for TUIJustin M. Keyes2019-09-12
| | | | | Even though it's always zero currently, it's less confusing if all UIs have the same fields.
* UIAttach, UIDetachJustin M. Keyes2019-09-12
| | | | | doc: ginit.vim, gvimrc fix #3656
* Merge pull request #10475 from erw7/fix-ext-popupmenuBjörn Linse2019-09-08
|\ | | | | Fix some keys not working in ext_popupmenu
| * Add nvim_ui_pum_set_height to apierw72019-09-08
| |
* | refactor: allow us to process a child queue only while waiting on inputBjörn Linse2019-09-08
|/
* screen: use dedicated message gridBjörn Linse2019-09-01
| | | | | | | | add proper msg_set_pos event, delet win_scroll_over_* make compositor click through unfocusable grids add MsgArea attribute for the message/cmdline area, and add docs and tests
* events: loop_schedule() is unclear, rename it loop_schedule_fast()Björn Linse2019-08-31
|
* ui: add 'redrawdebug' option for flexible debugging of redrawingBjörn Linse2019-07-09
|
* window: allow resize wincmds for floatsBjörn Linse2019-07-08
|
* UI/nvim_ui_attach(): add `override` optionJustin M. Keyes2019-05-09
| | | | | | | | | | | | | | | | | | | | Before now, Nvim always degrades UI capabilities to the lowest-common denominator. For example, if any connected UI has `ext_messages=false` then `ext_messages=true` requested by any other connected UI is ignored. Now `nvim_ui_attach()` supports `override=true`, which flips the behavior: if any UI requests an `ext_*` UI capability then the capability is enabled (and the legacy behavior is disabled). Legacy UIs will be broken while a `override=true` UI is connected, but it's useful for debugging: you can type into the TUI and observe the UI events from another connected (UI) client. And the legacy UI will "recover" after the `override=true` UI disconnects. Example using pynvim: >>> n.ui_attach(2048, 2048, rgb=True, override=True, ext_multigrid=True, ext_messages=True, ext_popupmenu=True) >>> while True: n.next_message();
* api: add width/height to FloatConfigMarco Hinz2019-03-16
|
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* ui: implement ext_messagesBjörn Linse2019-02-10
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* UI: always use contrete colors for default_colors_setBjörn Linse2019-02-05
| | | | | But add an escape hatch needed for external TUI, so it still can use terminal emulator defaults.
* rename ui_is_external to ui_has (#9576)Justin M. Keyes2019-02-03
|
* ui/compositor: add redraws needed due to intersected doublewidth chars.Björn Linse2019-02-02
|