Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ntdiary
Copy link
Contributor

@ntdiary ntdiary commented Sep 7, 2025

Problem:
a ghost cmdline appears when scrolling a full-height float window downward

Solution:
Change bot - MAX(rows, 0) to bot - 1 to correctly check if the float grid is being covered by msg_grid

will fix #34512

Additional notes:

  1. bot - 1 could also correctly detect if default_grid is covered by msg_grid when laststatus=0, this avoids triggering a recompose:
    v0.11.3 this PR
    v0.11.3.mp4
    this-pr.mp4
  2. bot - MAX(rows, 0) is introduced in PR #11025, and I also add a test case for its related issue #11019.
  3. BTW, a later PR #11121 ensures that attrbuf[i] > 0, so I feel the condition code below might be outdated. If we want to remove the code later, the test case might be useful.
    // TODO(bfredl): workaround for win_update() performing two scrolls in a
    // row, where the latter might scroll invalid space created by the first.
    // ideally win_update() should keep track of this itself and not scroll
    // the invalid space.
    if (curgrid->attrs[curgrid->line_offset[r - curgrid->comp_row]
    + (size_t)left - (size_t)curgrid->comp_col] >= 0) {
    compose_line(r, left, right, 0);
    }

This is the 4th issue I dug into. I picked up a lot of low-level concepts while debugging last week, but there might still be gaps in my understanding. Please feel free to point out anything if I'm wrong. :)

Problem:
a ghost cmdline appears when scrolling a full-height float window
downward

Solution:
Change `bot - MAX(rows, 0)` to `bot - 1` to correctly check if
the float grid is being covered by msg_grid
@ntdiary ntdiary marked this pull request as ready for review September 8, 2025 08:23
@zeertzjq zeertzjq requested a review from bfredl September 8, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: scroll issue with floating windows and cmdline
1 participant