aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
Commit message (Collapse)AuthorAge
* Merge branch 'aucmd_textputpost' into 20230125_mix20230125_mixJosh Rahm2023-02-02
|\
| * fix(column): estimate 'statuscolumn' width appropriatelyluukvbaal2023-02-02
| | | | | | | | | | | | | | | | | | | | | | Problem: The 'statuscolumn' width is being estimated without the proper context. In particular, this resulted in the fact that a custom fold column could be included in the estimated `number_width()`, and doubly added when actually drawing the statuscolumn due to `win_col_off()` also adding the `'foldcolumn'` width. Resulting in a status column that is `'foldcolumn'` cells wider than necessary. Solution: Estimate 'statuscolumn' width in `get_statuscol_str()` when a buffer's line count has changed.
* | feat(colorcolchar): implement 'foreground' flagJosh Rahm2023-02-02
| | | | | | | | | | | | | | | | | | | | This flag, denoted by an 'f', will force the character over the colorcolumn to take on the colorcolumn's highlight, discarding any highlight the character would have had otherwise. This is the inverse of the 'background' flag, where the colorcolumn will take the highlight of the character discarding any highlight it otherwise would have had.
* | feat(colorcolchar): make the colorcolumn more flexibleJosh Rahm2023-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR creates the ability to optionally decorate the colorcolumn(s) in other ways. Specifically it adds the ability to set: * The highlight group to highlight a colorcolumn with * A character to draw in a colorcolumn * whether the colorcolumn should mix its highlighting with the character in the column. The new syntax for colorcolumn is: set colorcolumn=[+|-]<num>[/<char>[/<hl_group>[/<flags>]]] By default the char is ' ', and the hl_group is 'ColorColumn' This PR does not change the existing semantics, just adds to them.
* | feat(colorcolchar): remove existing colorcolumnchar in the fillchars. Make ↵Josh Rahm2023-01-31
| | | | | | | | way for more flexibility
* | Merge remote-tracking branch 'upstream/master' into colorcolcharJosh Rahm2023-01-25
|\|
| * fix(extmarks): problems with folded virtual lines (#21930)luukvbaal2023-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When a folded line has virtual lines attached, the following problems occur: - The virtual lines are drawn empty. - The 'foldtext' line is drawn empty. - The cursor is drawn incorrectly. Solution: Check whether virtual lines belong to a folded line. Fix #17027 Fix #19557 Fix #21837 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor(PVS): suppress false positive V547 in drawline.c (#21875)Lucas Merritt2023-01-18
| | | | | | | | | | | | This is a false positive as "did_emsg" can be set by get_syntax_attr() Example: get_syntax_attr() -> syn_current_attr() -> syn_getcurline() -> ml_get_buf() -> siemsg() -> semsgv() -> emsg() -> emsg_multiline()
| * refactor: replace char_u with char 22 (#21786)dundargoc2023-01-17
| | | | | | Work on https://github.com/neovim/neovim/issues/459
| * fix(column): avoid drawing columns for virt_lines_leftcolLuuk van Baal2023-01-16
| | | | | | | | | | | | | | | | Problem: The default fold column, as well as the 'statuscolumn', were drawn unnecessarily/unexpectedly for virtual lines placed with `virt_lines_leftcol` set. Solution: Skip the column states if a virtual line with `virt_lines_leftcol` set will be drawn.
| * fix(column)!: ensure 'statuscolumn' works with virtual and wrapped linesLuuk van Baal2023-01-16
| | | | | | | | | | | | | | | | | | | | Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
| * refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | | | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
| * refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 20 (#21714)dundargoc2023-01-13
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * fix(statuscolumn): fix sign column highlights (#21727)luukvbaal2023-01-11
| | | | | | Resolve #21726.
| * fix(statuscolumn): fix crashes and clang/PVS warnings (#21725)zeertzjq2023-01-10
| |
| * test(statuscolumn): add more tests for wrapped lines (#21718)zeertzjq2023-01-10
| | | | | | | | | | | | test(statuscolumn): add more tests more wrapped lines Also initialize a "relnum" variable to suppress a Coverity warning. The uninitialized value wasn't actually used by build_statuscol_str().
| * docs: add 'statuscolumn' docstrings (#21717)luukvbaal2023-01-10
| |
| * feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | | | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
| * refactor: replace char_u with char 17 - remove STRLCPY (#21235)dundargoc2023-01-09
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with chardundargoc2023-01-09
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor(win_line): rename attr to vi_attr (#21487)zeertzjq2022-12-21
| | | | | | Vim renamed it in patch 8.1.1391.
| * refactor: replace char_u with chardundargoc2022-11-28
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-11-26
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:8.2.4062: match highlighting of tab too shortzeertzjq2022-11-24
| | | | | | | | | | | | | | | | | | | | Problem: Match highlighting of tab too short. Solution: Do not stop match highlighting if on a Tab. (Christian Brabandt, closes vim/vim#9507, closes vim/vim#9500) https://github.com/vim/vim/commit/0bbca540f7377889e2154aa5731f6eeffcb5c0cc Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.3698: match highlighting continues over breakindentzeertzjq2022-11-24
| | | | | | | | | | | | | | | | | | | | | | Problem: Match highlighting continues over breakindent. Solution: Stop before the end column. (closes vim/vim#9242) https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 Cherry-pick Test_matchdelete_redraw() from patch 8.2.1077. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: convert drawline.c draw states to enum (#21067)luukvbaal2022-11-15
| |
| * 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.
| * feat(extmarks): allow preventing spellchecking with spell = falseThomas Vigouroux2022-11-12
| |
| * Enable new diff option linematch (#14537)Jonathon2022-11-04
| | | | | | Co-authored-by: Lewis Russell <me@lewisr.dev>
| * refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
| * refactor: replace char_u with charDundar Göc2022-10-15
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | Merge remote-tracking branch 'upstream/master' into colorcolcharJosh Rahm2022-10-11
|\|
| * fix(extmarks): make virt_lines always start at 0 virtcolzeertzjq2022-09-25
| |
| * fix(redraw): make redrawdebug=nodelta handle all the casesbfredl2022-09-22
| | | | | | | | | | | | Before only win_line lines were considered. this applies nodelta to all screen elements. Causes some failures, which might indeed indicate excessive redraws.
| * refactor: suppress PVS false positives (#20264)zeertzjq2022-09-21
| | | | | | | | Some V512 warnings have changed to V1086, and PVS apparently does not know `uv_run()` can change `*timeout_expired`.
| * refactor: replace char_u with charDundar Göc2022-09-06
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * feat(extmarks,ts,spell): full support for spellingThomas Vigouroux2022-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added 'spell' option to extmarks: Extmarks with this set will have the region spellchecked. - Added 'noplainbuffer' option to 'spelloptions': This is used to tell Neovim not to spellcheck the buffer. The old behaviour was to spell check the whole buffer unless :syntax was set. - Added spelling support to the treesitter highlighter: @spell captures in highlights.scm are used to define regions which should be spell checked. - Added support for navigating spell errors for extmarks: Works for both ephemeral and static extmarks - Added '_on_spell_nav' callback for decoration providers: Since ephemeral callbacks are only drawn for the visible screen, providers must implement this callback to instruct Neovim which regions in the buffer need can be spell checked. The callback takes a start position and an end position. Note: this callback is subject to change hence the _ prefix. - Added spell captures for built-in support languages Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
| * refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | | | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-08-29
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor(plines): use a struct for chartabsize statebfredl2022-08-29
| | | | | | | | | | | | | | | | | | This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text The logic for inline virtual text is going to be different in nvim than text property based text in vim, but this refactor is still useful, as calculation of displayed linesize is going to be stateful in a similar way.
* | feat(colorcolchar): revert "feat: rename colorcol in fillchars to colorc"Josh Rahm2022-08-27
| | | | | | | | | | This reverts commit 234959abbfcf075cb09304b00fc391780580056d and renames the option 'colorc' -> 'colorcol' again.
* | feat(colorcolchar): rename colorcol in fillchars to colorcJosh Rahm2022-08-27
| | | | | | | | Rename the colorcol option in fillchars to the more terse colorc.
* | feat(colorcolchar): add the option "colorcol" to the fillchars settingJosh Rahm2022-08-27
|/ | | | | | | | | | | | | | This option will let neovim draw a character in the colorcolumn when there is no other character occupying that spot. For example, I'm someone who likes the elegance of seeing a 1px wide line at the 80 character mark, rather than a rectangle the width of a cell at that mark. To accomplish this, I run :set colorcol=80 :set fillchars=colorcol:│ of course ':' and '.' are good ASCII alteratives.
* refactor: change FALSE/TRUE to false/trueLewis Russell2022-08-26
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:9.0.0036: 'fillchars' cannot have window-local valueszeertzjq2022-08-26
| | | | | | | | | | | | | | | | Problem: 'fillchars' cannot have window-local values. Solution: Make 'fillchars' global-local. (closes vim/vim#5206) https://github.com/vim/vim/commit/96ba25ac01279f73c0ecb5d4aa4ff37aa359e5eb Cherry-pick g:run_nr from patch 8.2.0454. N/A patches for version.c: vim-patch:9.0.0037: build error Problem: Build error. Solution: Add missing change. https://github.com/vim/vim/commit/510f03738dfcadfe2099c5b6a58cb75f64dbaa82
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459