aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/statuscolumn_spec.lua
Commit message (Collapse)AuthorAge
* fix(column): apply custom highlight to last 'statuscolumn' segment (#32182)luukvbaal2025-01-24
|
* fix(mouse): 'statuscolumn' fold and popopmenu handlingLuuk van Baal2025-01-23
| | | | | | | | | 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.
* feat(api): combined highlights in nvim_eval_statusline()Luuk van Baal2025-01-23
| | | | | | | | | | | 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.
* feat(ui): sign/statuscolumn can combine highlight attrs #31575luukvbaal2024-12-14
| | | | | | | | Problem: Since e049c6e4c08a, most statusline-like UI elements can combine highlight attrs, except for sign/statuscolumn. Solution: Implement for sign/statuscolumn.
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
* refactor(tests): use more global highlight definitionsbfredl2024-11-11
|
* fix(mouse): don't treat click on hsep as click on statusline (#29565)zeertzjq2024-07-05
| | | This allows showing popup menu when right-clicking on hsep or cmdline.
* fix(mouse): early return when clicking in padded 'statuscolumn' (#29394)luukvbaal2024-06-19
| | | | | | Problem: Hit assert when clicking inside a padded 'statuscolumn' that is padded beyond the length of the allocated click_defs. Solution: Still consider this a "in_statuscol" click, but return early when about to execute the click func.
* feat(column)!: rework 'statuscolumn' %r/l itemsLuuk van Baal2024-06-16
| | | | | | | 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.
* feat(signs)!: place higher-priority signs from the left #27781Tobias Schmitz2024-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Higher-priority signs may be hidden by lower-priority signs. Solution: Place higher-priority signs from the left. Example: nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='H', priority=1}) nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='W', priority=2}) nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='E', priority=3}) Before: | | H | W E | ^ | | Not visible After: | | | E W | H | | ^ Not visible Fixes #16632
* feat(api): add nvim__redraw for more granular redrawingLuuk van Baal2024-05-02
| | | | | | | | | | | Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'.
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* refactor(tests): use new global defaults instead of set_default_attr_idsbfredl2024-03-26
| | | | This will be done in batches.
* refactor(tests): all screen tests should use highlightsbfredl2024-03-23
| | | | | | | | | | | | | | | | | | | | | | | This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
* fix(column): full redraw with 'stc, 'rnu' and inserted lines (#27712)luukvbaal2024-03-03
| | | | 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.
* fix(column): handle w_redr_statuscol at end filler lines (#27365)zeertzjq2024-02-06
| | | | There doesn't seem to be an easy solution that doesn't involve a goto. Also remove duplicate assignment in win_line().
* fix(column): redraw 'statuscolumn' on wrapped lines with 'relativenumber'Luuk van Baal2024-01-16
| | | | | | | Problem: The 'statuscolumn' is not redrawn on the wrapped part of a line when moving the cursor with 'relativenumber' set. Solution: Redraw the 'statuscolumn' for the entire line height in the "col_rows" win_line() code path.
* fix(column): keep track of number of lines with number of signsLuuk van Baal2024-01-15
| | | | | | | | | | | | | | | | | | | Problem: Some edge cases to the old (pre-#26406) and current "b_signcols" structure result in an incorrectly sized "auto" 'signcolumn'. Solution: * Implement a simpler 'signcolumn' validation strategy by immediately counting the number of signs in a range upon sign insertion and deletion. Decrease in performance here but there is a clear path forward to decreasing this performance hit by moving signs to a dedicated marktree, or by adding meta-data to the existing marktree which may be queried more efficiently? * Also replace "max_count" and keep track of the number of lines with a certain number of signs. This makes it so that it is no longer necessary to scan the entire buffer when the maximum number of signs decreases. This likely makes the commit a net increase in performance. * To ensure correctness we also have re-initialize the count for an edited region that spans multiple lines. Such an edit may move the signs within it. Thus we count and decrement before splicing the marktree and count and increment after.
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: typing for helpers.methsLewis Russell2024-01-12
|
* fix(column): fill 'statuscolumn' clickdefs with evaluated width (#26891)luukvbaal2024-01-05
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* fix(column): correct width after truncated 'statuscolumn' error (#26737)luukvbaal2023-12-26
| | | | | Problem: Default number column has incorrect width after 'statuscolumn' is unset due to an error, but was also truncated. Solution: Reverse 'statuscolumn' error and truncate return branches.
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
* fix(mouse): avoid dragging when clicking next to popupmenu (#26201)luukvbaal2023-11-25
|
* fix(mouse): avoid dragging after click label popupmenu callback (#26187)luukvbaal2023-11-24
|
* fix(column): reset decor state before starting from topLuuk van Baal2023-11-23
|
* refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* feat(statuscolumn): re-evaluate for every screen line (#25885)luukvbaal2023-11-13
| | | | | Problem: v:virtnum is less useful than it could be. Solution: Always re-evaluate 'statuscolumn', and update v:virtnum accordingly.
* fix(statuscolumn): update number hl for each screen line (#25277)zeertzjq2023-09-21
|
* fix(mouse): click on 'statuscolumn' with 'rightleft' (#25090)zeertzjq2023-09-11
|
* fix(statuscolumn): force full redraw when signcolumn is invalid (#24859)luukvbaal2023-08-26
| | | Fix #24655
* fix(statuscolumn): don't update clicks if current width is 0 (#24459)zeertzjq2023-07-24
|
* fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n (#24268)zeertzjq2023-07-06
|
* fix(column): handle unprintable chars in 'statuscolumn' (#24198)zeertzjq2023-06-29
|
* fix(statusline): corrupted screen with minwid sign item in 'statuscolumn' ↵luukvbaal2023-05-30
| | | | (#23823)
* fix(folds): combined Folded and Visual highlights (#23752)zeertzjq2023-05-25
| | | Also combine high-priority CursorLine with Folded.
* fix(folds): show Folded highlight in Visual selection (#23741)zeertzjq2023-05-24
| | | Note: CursorLine highlight is now combined with Folded.
* fix(redraw): multibyte characters are wrapped at the end of a line (#23696)luukvbaal2023-05-21
| | | | | | Problem: Multibyte characters may be wrapped at the end of a line when 'statuscolumn' and 'spell' are set. Solution: Update line pointerdiff "v" before fetching the line pointer after evaluating 'statuscolumn'.
* fix(statusline): also allow right click when 'mousemodel' is "popup*" (#23258)luukvbaal2023-04-25
| | | | | Problem: The 'statusline'-format ui elements do not receive right click events when "mousemodel" is "popup*" Solution: Do not draw popupmenu and handle click event instead.
* fix(column): rebuild status column when sign column is invalidLuuk van Baal2023-04-19
|
* test(column): statuscolumn is rebuild when signs are (un)placedLuuk van Baal2023-04-19
|
* fix(mouse): cmdline click registered as statuscolumn (#23163)luukvbaal2023-04-18
|
* fix(column): add truncated width during estimation for 'statuscolumn'luukvbaal2023-04-12
| | | | | | Problem: Estimated 'statuscolumn' width estimated is not properly used, executing the `w_redr_statuscol` path unnecessarily. Solution: Adjust `w_nrwidth` and 'statuscolumn' width before anything is actually drawn in a `win_update()`.
* fix(column): 'statuscolumn' not drawn after virt_lines with "n" in 'cpo' ↵luukvbaal2023-04-10
| | | | | | | | (#22967) Problem: The 'statuscolumn' is not drawn and the line itself is drawn at an offset to the rest of the buffer after virt_lines if 'cpoptions' includes "n". Solution: Make sure 'statuscolumn' is drawn.
* fix(column): rebuild status column when sign column is invalidated (#22690)luukvbaal2023-03-18
| | | | | | | | | | | * fix(column): rebuild status column when sign column is invalidated Problem: When implementing a custom sign column through `'statuscolumn'`, the status column is not properly rebuilt when the sign column width changes. Solution: Force a rebuild of the status column when the sign column width is invalidated. * test(column): 'statuscolumn' has correct width when (un)placing signs
* test(statuscolumn_spec): remove unnecessary feed('lh')zeertzjq2023-03-18
| | | It is no longer needed after #22706.
* fix(column): issues with 'statuscolumn' width (#22542)luukvbaal2023-03-07
| | | | | | | | Problem: 'statuscolumn' width can be incorrect when toggling 'number' or setting 'statuscolumn'. Solution: Make sure the width is reset and re-estimated when 'statuscolumn' and 'number' are set. (When 'relativenumber' is set this already happens because it always changes "nrwidth_line_count".)