aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/grid.h
Commit message (Collapse)AuthorAge
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq2023-11-27
|
* build(IWYU): replace public-to-public mappings with pragmas (#26237)zeertzjq2023-11-27
|
* 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.
* refactor(grid): implement rightleftcmd as a post-processing stepbfredl2023-11-03
| | | | | | | Previously, 'rightleftcmd' was implemented by having all code which would affect msg_col or output screen cells be conditional on `cmdmsg_rl`. This change removes all that and instead implements rightleft as a mirroring post-processing step.
* docs: small fixes (#25585)dundargoc2023-10-29
| | | | Co-authored-by: tmummert <doczook@gmx.de> Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
* build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* 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.
* vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'zeertzjq2023-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Wrong cursor position when clicking after concealed text with 'virtualedit'. Solution: Store virtual columns in ScreenCols[] instead of text columns, and always use coladvance() when clicking. This also fixes incorrect curswant when clicking on a TAB, so now Test_normal_click_on_ctrl_char() asserts the same results as the ones before patch 9.0.0048. closes: vim/vim#12808 https://github.com/vim/vim/commit/e500ae8e29ad921378085f5d70ee5c0c537be1ba Remove the mouse_adjust_click() function. There is a difference in behavior with the old mouse_adjust_click() approach: when clicking on the character immediately after concealed text that is completely hidden, cursor is put on the clicked character rather than at the start of the concealed text. The new behavior is better, but it causes unnecessary scrolling in a functional test (which is an existing issue unrelated to these patches), so adjust the test. Now fully merged: vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
* 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: replace char_u with charDundar Göc2022-09-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell2022-08-19
| | | | | | | | | | | | | | | Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: move non-symbols in mbyte.h to mbyte_defs.hzeertzjq2022-08-08
| | | | | This just avoids including mbyte.h in eval/typval.h, so that mbyte.h can include eval/typval.h in Vim patch 8.2.1535.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor(grid): move out grid_* functions from screen.cbfredl2022-05-08
Also normalize some types. use "size_t" for unsigned array offsets. Fix -Wconversion issues missed as screen.c is missing this check.