aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
Commit message (Collapse)AuthorAge
...
* 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.
* tui: Use underline cursor in Replace modeOmar Sandoval2015-07-26
| | | | | | | This is a port of my original contribution to Vim, added in 7.4.687 (https://github.com/vim/vim/commit/v7-4-687). The TUI code has been heavily refactored (see esp. 25ceadab37edba13f5afa78d8b4723da03ef35f0), so this required some translation, but the logic is the same.
* api: Simplify UI API on mode changeOmar Sandoval2015-07-26
| | | | | | | Currently, there are two functions in the UI API that are called when the mode changes: insert_mode() and normal_mode(). These can be folded into a single mode_change() entrypoint which can do whatever it wants based on the mode it is passed, limited to INSERT and NORMAL for now.
* 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.
* tui: make termkey use utf-8 mode when &encoding=utf-8 #2469Björn Linse2015-06-13
|
* ui: Schedule screen refreshs to run in the event loopThiago de Arruda2015-03-25
| | | | | This is required to avoid event loop recursion due to indirect calls to os_breakcheck by screenalloc
* ui: Refactor so that busy state won't be the defaultThiago de Arruda2015-03-18
| | | | | | | | | | | Even though assuming nvim is busy most times is simpler, it has a problem: A lot of unnecessary busy_start/busy_stop notifications are sent to the UI. That's because in the majority of scenarios almost no time is spent between `event_poll` calls. This restores the normal behavior which is to call busy_start only when nvim is going to perform some task that can take a significant amount of time. Also improve the usage of buffering in the TUI when changing the cursor state.
* ui: Only call ui_flush when the busy state changesThiago de Arruda2015-03-16
| | | | | Also add back the `ui_flush` call to `get_keystroke`. Its necessary to display prompt messages correctly.
* ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
| | | | | | | | | | | | | | | | | | | | | | | | Switching cursor off is only necessary in two occasions: - When redrawing to avoid terminal flickering - When the editor is busy The first can now be handled by the TUI, so most calls to ui_cursor_off can be removed from the core. So, before this commit it was only necessary to switch the cursor off to notify the user that nvim was running some long operation. Now the cursor_{on,off} functions have been replaced by busy_{stop,start} which can be handled in a UI-specific way(turning the cursor off or showing a busy indicator, for example). To make things even more simpler, nvim is always busy except when waiting for user input or other asynchronous events: It automatically switches to a non-busy state when the event loop is about to be entered for more than 100 milliseconds. `ui_busy_start` can be called when its not desired to change the busy state in the event loop (As its now done by functions that perform blocking shell invocations).
* illumos requires the use of limits.h for things like INT_MAX #2049Mike Zeller2015-02-26
|
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* Enable -Wconversion: ui.c.Eliseo Martínez2015-02-18
| | | | | | | | | | | | | | | Refactoring summary: - ui_write(): len: int --> size_t * parse_abstract_ui_codes(): len: int --> size_t * string_convert(): lenp: int * --> size_t * - string_convert_ext(): lenp : int * --> size_t * unconvlenp: int * --> size_t * * utf8len_tab_zero: char[] --> uint8_t[] * iconv_string(): slen : int --> size_t unconvlenp: int * --> size_t * resultlenp: int * --> size_t * - mch_print_text_out(): len: int --> size_t * out_pos: int --> size_t
* syntax: Refactor to store all term and gui attributes independentlyThiago de Arruda2015-02-16
| | | | | Now the attrentry_T structure will store all attributes in separate fields for cterm and rgb UIs.
* ui: Rewrite the builtin terminal UIThiago de Arruda2015-02-16
| | | | | Now all terminal-handling code was moved to src/nvim/tui, which implements a new terminal UI based on libtermkey and unibilium
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* ui: Remove redundant cursor_goto callsThiago de Arruda2015-02-16
|
* ui: Implement set_{title,icon}Thiago de Arruda2015-01-14
|
* main: Fix color schemes for abstract_uiThiago de Arruda2015-01-13
| | | | | | | | | - Set 't_Co' to 256 at startup. The value can be changed by the user for compatibility with terminals that are less capable. - `has('gui_running')` will return 1 if at least one rgb UI is attached. Even though these changes are hacky, they are necessary to make the transition to the new UI architecture smoother.
* ui: Fix redraw bug caused by race conditions with remote clientsThiago de Arruda2015-01-13
| | | | | Before sending a resize command to the UIs, flush the current output buffer to ensure no redraw commands for a screen with invalid size are processed.
* ui: Use ui_linefeed to handle line breaks correctlyThiago de Arruda2015-01-13
| | | | | ui_linefeed will scroll the screen when it becomes full. This can happen when executing external commands.
* ui: Fix out_flush/ui_write behavior to always flush for abstract_uiThiago de Arruda2015-01-13
|
* ui: Fix `:suspend` command for remote UIsThiago de Arruda2015-01-13
| | | | | Forward the command to the remote UI and flush immediately. The semantics/handling is UI-specific.
* ui: Don't parse abstract_ui codes if there are no attached UIsThiago de Arruda2015-01-13
|
* ui: Add 'rgb' parameter to ui_attachThiago de Arruda2015-01-13
| | | | When set to false, nvim will send cterm color numbers with `highlight_set`.
* ui: Merge standout and reverse into one attributeThiago de Arruda2015-01-13
|
* ui: Fix ui resizing and change some method namesThiago de Arruda2015-01-13
|
* ui: Increase cursor row when text being rendered would cross its limitThiago de Arruda2015-01-13
|
* ui: Add update_fg/update_bg methodsThiago de Arruda2015-01-13
| | | | | It is necessary to notify the UI when the default background/foreground colors change in order to render correctly.
* Revert "[WIP] "abstract_ui" fixes and improvements"Justin M. Keyes2015-01-12
|
* Merge pull request #1657 from tarruda/abstract-ui-fixesJustin M. Keyes2015-01-12
|\ | | | | [WIP] "abstract_ui" fixes and improvements
| * ui: Fix redraw bug caused by race conditions with remote clientsThiago de Arruda2015-01-12
| | | | | | | | | | Before sending a resize command to the UIs, flush the current output buffer to ensure no redraw commands for a screen with invalid size are processed.
| * ui: Use ui_linefeed to handle line breaks correctlyThiago de Arruda2015-01-12
| | | | | | | | | | ui_linefeed will scroll the screen when it becomes full. This can happen when executing external commands.
| * ui: Fix out_flush/ui_write behavior to always flush for abstract_uiThiago de Arruda2015-01-12
| |
| * ui: Reimplement `:suspend` command for remote UIs.Thiago de Arruda2015-01-12
| | | | | | | | | | | | - Remove suspend method from the UI protocol - Handle `:suspend` by disconnecting the last channel that sent a request to nvim.
| * ui: Don't parse abstract_ui codes if there are no attached UIsThiago de Arruda2015-01-12
| |
| * ui: Add 'rgb' parameter to ui_attachThiago de Arruda2015-01-12
| | | | | | | | When set to false, nvim will send cterm color numbers with `highlight_set`.
| * ui: Dont resize screen if no UIs are attachedThiago de Arruda2015-01-12
| | | | | | | | | | This prevents a race condition when a UI attaches early in the program and can receive redraw commands for a invalid screen
| * ui: Merge standout and reverse into one attributeThiago de Arruda2015-01-12
| |
| * ui: Fix ui resizing and change some method namesThiago de Arruda2015-01-12
| |
| * ui: Increase cursor row when text being rendered would cross its limitThiago de Arruda2015-01-10
| |
| * ui: Add update_fg/update_bg methodsThiago de Arruda2015-01-10
| | | | | | | | | | It is necessary to notify the UI when the default background/foreground colors change in order to render correctly.
* | Cleanup: Rename getdigits() family functions.Eliseo Martínez2015-01-11
| |
* | Cleanup: Refactor getdigits().Eliseo Martínez2015-01-11
|/ | | | | | | | | | | | | | | | Problem : getdigits() currently returns a long, but at most places, return value is casted (unsafely) into an int. Making casts safe would introduce a lot of fuss in the form of assertions checking for limits. Note : We cannot just change return type to int, because, at some places, legitimate long values are used. For example, in diff.c, for line numbers. Solution : Introduce new functions: - get_digits() : Gets an intmax_t from a string. - get_int_digits() : Wrapper for ints. - get_long_digits() : Wrapper for longs. And replace getdigits() invocations by the appropiate wrapper invocations.
* syntax: Use RGB/GUI attribute information for "abstract_ui"Thiago de Arruda2014-12-08
| | | | | | | | Instead of using classic cterm color numbers and attributes, treat "abstract_ui" as a GUI: Pass rgb color numbers and gui attributes when the "highlight_set" UI method is called. The terminal UI will have to translate RGB color information to an appropriate color number, and the "term"/"cterm" :highlight keys will eventually be deprecated.
* ui: Add abstract_ui termcap and split UI layerThiago de Arruda2014-12-08
| | | | | | | | | | | | | | | | | | This is how Nvim behaves when the "abstract_ui" termcap is activated: - No data is written/read to stdout/stdin by default. - Instead of sending data to stdout, ui_write will parse the termcap codes and invoke dispatch functions in the ui.c module. - The dispatch functions will forward the calls to all attached UI instances(each UI instance is an implementation of the UI layer and is registered with ui_attach). - Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by input_enqueue and the translated strings are pushed to the input buffer. With this new input model, its not possible to send mouse events yet. Thats because mouse sequence parsing happens in term.c/check_termcodes which must return early when "abstract_ui" is activated.
* Merge pull request #1186 from splinterofchaos/writeJustin M. Keyes2014-11-28
|\ | | | | Non-unix-specific os_unix function.
| * mch_write -> term_writeScott Prager2014-11-28
| | | | | | | | | | | | Switch from POSIX's write() to fwrite(stdout,...) and disable buffering since vim buffers output explicitly and flushes when needed, like when a key is typed.
* | ui: Move check_col/check_row functions to mbyte.cThiago de Arruda2014-11-27
| | | | | | | | | | These functions were only being used by mbyte.c, so move them and add the "static" modifier.
* | Remove code defined under USE_IM_CONTROL #ifdefsThiago de Arruda2014-11-27
|/ | | | This is not being used and should not be part of the core anyway.
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c