| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long
Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: A right-click on the 'statuscolumn' does not open the
popupmenu, even if a cell without a clickdef is clicked.
Clicking the %C fold item does not open/close the fold.
Solution: Open the popupmenu when there is no clickdef like right-clicking
the sign/numbercolumn does. Fill "linebuf_vcol" when drawing the
'statuscolumn' to handle foldcolumn item clicks.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Combined highlighting was not applied to nvim_eval_statusline(),
and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
`nvim_eval_statusline()->highlights`. This is an array of stacked
highlight groups (highest priority last). Also resolve combined
highlights for the 'statuscolumn' sign segment/numhl highlights.
Expose/synchronize some drawline.c logic that is now mimicked in
three different places.
|
|
|
|
|
|
|
|
|
| |
If a "on_lines" callback changes the structure of the marktree, the
iterator (which is used for an entire window viewport) might now
point to invalid memory. Restore the iterator to the beginning of the
line in this case.
fixes #29484
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
preview window
Problem: completion may crash, completion highlight wrong with preview
window (after v9.1.0954)
Solution: correctly calculate scroll offset, check for preview window
when adding extra highlighting
(glepnir)
when there have a preview window prepare_tagpreview
will change curwin to preview window and this may cause
ComplMatchIns check condition not correct. check wp is curwin
and also the type of wp is not a preview or poup info
fixes: https://github.com/vim/vim/issues/16284
closes: https://github.com/vim/vim/pull/16283
https://github.com/vim/vim/commit/8d0bb6dc9f2e5d94ebb59671d592c1b7fa325ca6
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#31628)
Problem: ComplMatchIns highlight doesn't end after inserted text.
Solution: Handle ComplMatchIns highlight more like search highlight.
Fix off-by-one error. Handle deleting text properly.
(zeertzjq)
closes: vim/vim#16244
https://github.com/vim/vim/commit/f25d8f9312a24da2727671560a865888812ab8d9
|
|
|
|
|
|
|
|
|
|
| |
Problem: ComplMatchIns doesn't work after multibyte chars
(after v9.1.0936)
Solution: Use (ptr - line) instead of wlv.col (zeertzjq).
closes: vim/vim#16233
https://github.com/vim/vim/commit/f4ccada5c372b2c14cc32490860c6995cd00268c
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: cannot highlight completed text
Solution: (optionally) highlight auto-completed text using the
ComplMatchIns highlight group (glepnir)
closes: vim/vim#16173
https://github.com/vim/vim/commit/6a38aff218f5b99a1aed7edaa357df24b9092734
Co-authored-by: glepnir <glephunter@gmail.com>
|
|
|
|
|
|
|
|
| |
Problem:
Since e049c6e4c08a, most statusline-like UI elements can combine
highlight attrs, except for sign/statuscolumn.
Solution:
Implement for sign/statuscolumn.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Option metadata like list of valid values for an option and
option flags are not listed in the `options.lua` file and are instead
manually defined in C, which means option metadata is split between
several places.
Solution: Put metadata such as list of valid values for an option and
option flags in `options.lua`, and autogenerate the corresponding C
variables and enums.
Supersedes #28659
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Crash with cursor-screenline and narrow window
(elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).
fixes: vim/vim#15677
closes: vim/vim#15678
https://github.com/vim/vim/commit/59149f02692804267e7cc0665d0334f6ff4675be
|
|
|
|
|
|
|
|
|
|
| |
Problem: Wrong cursor-screenline when resizing window
Solution: Invalidate saved left_col and right_col when width1 or width2
change.
closes: vim/vim#15679
https://github.com/vim/vim/commit/86dc4f8b432233a01d022c3e71df53db58229713
|
|
|
|
|
|
|
|
|
| |
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.
Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`'scrollbind'` does not work properly if the window being scrolled
automatically contains any filler/virtual lines (except for diff filler
lines).
This is because when the scrollbind check is done, the logic only
considers changes to topline which are represented as line numbers.
Solution:
Write the logic for determine the scroll amount to take into account
filler/virtual lines.
Fixes #29751
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Variables are often assigned multiple places in common patterns.
Solution:
Replace these common patterns with different patterns that reduce the
number of assignments.
Use `MAX` and `MIN`:
```c
if (x < y) {
x = y;
}
// -->
x = MAX(x, y);
```
```c
if (x > y) {
x = y;
}
// -->
x = MIN(x, y);
```
Use ternary:
```c
int a;
if (cond) {
a = b;
} els {
a = c;
}
// -->
int a = cond ? b : c;
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reduce calls to hasFolding() and remove the has_fold argument.
For lines that don't have virtual lines this should be more efficient as
it should avoid any calls to hasFolding(), whereas before it was called
at least once for any buffer containing at least one virtual line.
This will be slightly less efficient for lines with multiple virtual
lines marks as hasFolding() is called once for each mark. This could be
optimized, but having multiple virtual lines marks on a single line is
very rare.
|
| |
|
|
|
|
|
|
|
| |
Problem: A custom 'statuscolumn' needs to check a bunch of options and
placed signs to replicate the default number column.
Solution: Rework %l item to include the necessary logic to mimic the
default number column. Remove now redundant %r item.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in drawline.c
Solution: Refactor code to avoid strlen()
(John Marriott)
closes: vim/vim#14890
https://github.com/vim/vim/commit/f51ff96532ab8f97f779b44d17dccdda9d8ce566
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
|
| |
Problem: Numberwidth may depend on number of signs with text in the
buffer and is not handled correctly for extmark signs.
Solution: Move legacy sign code for changed numberwidth so that it is
handled properly for legacy and extmark signs alike.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Cannot move to previous/next rare word
(Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)
fixes: vim/vim#14773
closes: vim/vim#14780
https://github.com/vim/vim/commit/8e4c4c7d87def2b100a5d64dc518ef85d9de8765
Co-authored-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
|
|
|
|
|
|
|
|
|
| |
Problem:
Decoration provider `on_line` handler is invoked for diff filler line
below the last buffer line. This does not match the documentation:
"called for each buffer line".
Solution:
Check `end_fill`.
|
|
|
|
|
|
|
|
|
|
|
|
| |
've' and conceal (#27903)
Problem: Wrong cursor position when clicking after end of line with
'rightleft', 'virtualedit' and conceal.
Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT. Also fix
off-by-one cursor position with 'colorcolumn' (zeertzjq).
closes: vim/vim#14218
https://github.com/vim/vim/commit/deb2204bffa075ed5485415fc2dbd20e75d87ea4
|
|
|
|
|
| |
Problem: Wrong cursor position when clicking after end of line with
'virtualedit', conceal and virtual text.
Solution: Always fill linebuf_vcol[] for the columns to clear.
|
|
|
|
|
|
|
| |
There is no test for using 'cursorline' in Normal mode in a terminal
buffer, so add a test and fix 'cursorcolumn' remaining when entering
Terminal mode.
Also move synIDattr() tests to ui/highlight_spec.lua.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#27890)
Problem: Cursor position wrong when clicking with conceal and wrap.
Solution: Use the virtual column of the last char for ScreenCols[] in
boguscols. Remove use of MAXCOL in ScreenCols[]. Rename
third argument of wlv_screen_line() to "clear_end" as that's
clearer what it does (zeertzjq).
related: 14192
closes: vim/vim#14200
https://github.com/vim/vim/commit/d0c1b7723f7e73763597af2f97a53d94ab7ed020
Rename win_put_linebuf() to wlv_put_linebuf().
|
|
|
|
| |
The only place it matters is the conceal wcol check, but it can avoid
unnecessary computations at other places.
|
|
|
|
| |
It isn't really used, and is always passed 0.
Also rename "start_col" to "startcol" for consistency with "endcol".
|
|
|
|
|
|
|
|
|
|
|
| |
(#27862)
Problem: Cursor pos wrong when double-width chars are concealed.
Solution: Advance one more virtual column for a double-width char.
Run some tests with both 'wrap' and 'nowrap' (zeertzjq).
closes: vim/vim#14197
https://github.com/vim/vim/commit/010e1539d67442cc69a97bef6453efaf849d0db3
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
CursorColumn highlight behavior is inconsistent with 'virtualedit' set:
- If cursor is on the text, CursorColumn is not shown.
- If cursor is after end of line, CursorColumn is shown.
Solution:
Don't shown CursorColumn on current line if cursor is after end of line.
Vim doesn't have this problem because in most cases it uses the code
path for drawing buffer text when CursorColumn highlight is needed.
|
|
|
|
|
| |
It is clearing that it's for conceal and matches the change from Vim
patch 9.0.1325.
Also correct some comments related to fix_for_boguscols().
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not
set ml_line_textlen in ml_replace_len() if "has_props" is set,
because "len_arg" also includes the size of text properties in
that case. (zeertzjq)
closes: vim/vim#14183
https://github.com/vim/vim/commit/94b7c3233ef534acc669b3083ed1fe59cf3a090b
|
|
|
|
|
|
|
|
|
|
| |
Problem: Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
(zeertzjq)
closes: vim/vim#14190
https://github.com/vim/vim/commit/253ff4dece4e6cc4a9ff3ed935bc78f832b6fb7c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: 'cursorline' and 'wincolor' highlight missing with concealed and
wrapped lines.
Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols.
(zeertzjq)
Since 'cursorline' and 'wincolor' highlight apply after the end of the
line, it is more consistent to have them also apply to boguscols.
Assigning MAXCOL to values in ScreenCols[] make mouse click behave the
same with 'cursorline' and 'nocursorline', but such behavior may be
incorrect, as it puts the cursor on the next screen line. That may be
fixed in a future PR.
closes: vim/vim#14192
https://github.com/vim/vim/commit/21b0a3df8c4abb884489dfcc0c92b1bbe058f291
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of functions in move.c only worked for curwin, alternatively
took a `wp` arg but still only work if that happens to be curwin.
Refactor those that are needed for update_topline(wp) to work
for any window.
fixes #27723
fixes #27720
|
|
|
| |
This also obviates the end-of-line loop when there is virtual text.
|
|
|
|
| |
Problem: Text is not redrawn with 'relativenumber' when only the 'statuscolumn' is redrawn after inserted lines.
Solution: Force a full redraw if statuscolumn width changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
list char (#27600)
Problem: Virtual text with text_wrap 'wrap' was effectively being
truncated by a break conditional on the EOL list character
being added to the screen line. (BigPeet)
Solution: Remove the condition that was leading to the early break and
instead fix a similar but incorrectly written outer condition
that checks if there is more to add at the end of the screen
line. (Dylan Thacker-Smith)
Also, related:
- update comment in win_line()
- remove no longer necessary at_end_str variable in win_line()
fixes: vim/vim#12725
closes: vim/vim#14079
https://github.com/vim/vim/commit/f548ae7b6357c7934411df243bc987800c9b76d1
Co-authored-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
|
| |
|
|
|
|
| |
There doesn't seem to be an easy solution that doesn't involve a goto.
Also remove duplicate assignment in win_line().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#27363)
Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
(zeertzjq)
closes: vim/vim#13974
https://github.com/vim/vim/commit/ebfd856cfdf6ea0b16c8d115000961c998ce97da
Cherry-pick test_number.vim changes from patch 9.0.0626.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Things that temporarily change/restore curwin/buf (e.g:
win_execute, some autocmds) may break assumptions that
curwin/buf is the cmdwin when "cmdwin_type != 0", causing
issues.
Solution: Expose the cmdwin's real win/buf and check that instead. Also
try to ensure these variables are NULL if "cmdwin_type == 0",
allowing them to be used directly in most cases without
checking cmdwin_type. (Sean Dewar)
Reset and save `cmdwin_old_curwin` in a similar fashion.
Apply suitable changes for API functions and add Lua tests.
https://github.com/vim/vim/commit/988f74311c26ea9917e84fbae608de226dba7e5f
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This expands on the global "don't pay for what you don't use" rules for
these special extmark decorations:
- inline virtual text, which needs to be processed in plines.c when we
calculate the size of text on screen
- virtual lines, which are needed when calculating "filler" lines
- signs, with text and/or highlights, both of which needs to be
processed for the entire line already at the beginning of a line.
This adds a count to each node of the marktree, for how many special
marks of each kind can be found in the subtree for this node. This makes
it possible to quickly skip over these extra checks, when working in
regions of the buffer not containing these kind of marks, instead of
before where this could just be skipped if the entire _buffer_
didn't contain such marks.
|