aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ugrid.h
Commit message (Collapse)AuthorAge
* refactor: iwyu (#26269)zeertzjq2023-11-28
|
* refactor(IWYU): fix includes for ugrid.h (#26267)zeertzjq2023-11-28
|
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor(grid): change schar_T representation to be more compactbfredl2023-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a screen cell would occupy 28+4=32 bytes per cell as we always made space for up to MAX_MCO+1 codepoints in a cell. As an example, even a pretty modest 50*80 screen would consume 50*80*2*32 = 256000, i e a quarter megabyte With the factor of two due to the TUI side buffer, and even more when using msg_grid and/or ext_multigrid. This instead stores a 4-byte union of either: - a valid UTF-8 sequence up to 4 bytes - an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a glyph cache This avoids allocating space for huge composed glyphs _upfront_, while still keeping rendering such glyphs reasonably fast (1 hash table lookup + one plain index lookup). If the same large glyphs are using repeatedly on the screen, this is still a net reduction of memory/cache consumption. The only case which really gets worse is if you blast the screen full with crazy emojis and zalgo text and even this case only leads to 4 extra bytes per char. When only <= 4-byte glyphs are used, plus the 4-byte attribute code, i e 8 bytes in total there is a factor of four reduction of memory use. Memory which will be quite hot in cache as the screen buffer is scanned over in win_line() buffer text drawing A slight complication is that the representation depends on host byte order. I've tested this manually by compling and running this in qemu-s390x and it works fine. We might add a qemu based solution to CI at some point.
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* refactor: format all C files under nvim/ #15977dundargoc2021-10-12
| | | | | | | | * refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
* UGRID_FOREACH_CELL: avoid shadowed variablesJustin M. Keyes2019-01-02
|
* UI/TUI: improvements and cleanups for scrolling and clearingBjörn Linse2018-11-11
| | | | | | | | | | | | - TUI: _never_ rely on BCE for implicit clearing, only explicit commands. - TUI: use unibi_erase_chars when possible. - TUI: use end-exclusive ranges for invalid and cleared areas - screen: scrolling leaves scrolled in aree undefined. This is a conservative change, a client assuming the old semantics will still behave correctly. - screen: factor out vsep handling from line drawing. This is needed anyway for the multigrid refactor. - screen: simplifications of win_do_lines
* tui: eliminate scrolling region data structureBjörn Linse2018-09-27
| | | | | | | | | The scrolling region is always local to a single grid_scroll event, use local variables and parameters instead. The invocation of reset_scroll_region in grid_resize is cargo-culted to use margin reset under exactly the same circumstances, not sure if it is necessary though.
* tui: eliminate grid->attrs, use indexed cell->attrBjörn Linse2018-09-26
| | | | remove dead ugrid_put
* ui: use line-based rather than char-based updates in screen.cBjörn Linse2018-07-21
| | | | | | | | | | | | | Add ext_newgrid and ext_hlstate extensions. These use predefined highlights and line-segment based updates, for efficiency and simplicity.. The ext_hlstate extension in addition allows semantic identification of builtin and syntax highlights. Reimplement the old char-based updates in the remote UI layer, for compatibility. For the moment, this is still the default. The bulitin TUI uses the new line-based protocol. cmdline uses curwin cursor position when ext_cmdline is active.
* ugrid: Silence PVS/V625: UGRID_FOREACH_CELL may be used for one rowZyX2018-04-22
|
* ui/tui: highlighting refactorBjörn Linse2018-02-11
| | | | | | | | Make HlAttr contain highlighting state for both color modes (cterm and rgb). This allows us to implement termguicolors completely in the TUI. Simplify some logic duplicated between ui.c and screen.c. Also avoid some superfluous highlighting reset events.
* Adds nvim_get_hl_by_name/by_idMatthieu Coudron2017-09-30
| | | | | | | | | ...in order to retrieve highlights. Added test/functional/api/highlight_spec.lua HL_NORMAL is not really a good name, since it's more like an empty attribute than the normal's one. If one pays attention, syn_cterm_attr2entry is never called with attr=0 because it's always special cased before. I suggest in subsequent PRs we remove the ATTR_OFF and just insert an EMPTY ATTR/RESET_ATTR/UNINITIALIZED for id 0.
* *: Also fix the adjacent errorsZyX2016-06-11
|
* *: Fix errors from new linter checksZyX2016-06-11
|
* LintingAdnoC2016-05-17
|
* syntax: Add support for the "special" color used for undercurlsAdnoC2016-05-17
|
* ugrid: Increase cell size to allow unicode compositionThiago de Arruda2015-09-18
| | | | Close #3323
* tui: Move screen state tracking to new "ugrid" moduleThiago de Arruda2015-09-06
The ugrid module implements a unicode "drawing" grid and is used to store TUI screen state. Later this module will be reused in other layers.