Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursor drawn on command-line when 'smoothscroll' is enabled #11288

Closed
lacygoill opened this issue Oct 5, 2022 · 8 comments
Closed

cursor drawn on command-line when 'smoothscroll' is enabled #11288

lacygoill opened this issue Oct 5, 2022 · 8 comments

Comments

@lacygoill
Copy link

Steps to reproduce

Run this shell command:

vim -Nu NONE -S <(tee <<'EOF'
    vim9script
    &smoothscroll = true
    &wrap = true
    &lines = 24
    vsplit
    var text: string = 'the quick brown fox jumps over the lazy dog '
    [text->repeat(&columns / text->strcharlen() + 1)]->repeat(&lines)->setline(1)
    feedkeys('j'->repeat(&lines), 'xnt')
EOF
)

The cursor is drawn on the command-line, below the statusline .

Expected behavior

The cursor is drawn on the last line of the buffer, above the statusline.

Version of Vim

9.0 Included patches: 1-662

Environment

Operating system: Ubuntu 20.04.5 LTS
Terminal: XTerm(353)
Value of $TERM: xterm-256color
Shell: GNU bash, version 5.0.17

Gif

gif

Additional context

The issue disappears if we reset 'smoothscroll'.


The issue seems to be influenced by &lines. For example, I can't reproduce when &lines = 10; but I can when &lines = 24.

@brammool
Copy link
Contributor

brammool commented Oct 5, 2022

I tried this and a few variants, but I cannot reproduce.

@lacygoill
Copy link
Author

I'm on 9.0.669 and I can still reliably reproduce. But as mentioned earlier, it depends on the number of lines. For me, it works with 24 lines.

I wonder whether the font size also affects the issue. I can reproduce in xterm, with no config:

$ xrdb /dev/null
$ xterm
$ HOME=/tmp vim -Nu NONE -i NONE -U NONE -S <(tee <<'EOF'
    vim9script
    &smoothscroll = true
    &wrap = true
    &lines = 24
    vsplit
    var text: string = 'the quick brown fox jumps over the lazy dog '
    [text->repeat(&columns / text->strcharlen() + 1)]->repeat(&lines)->setline(1)
    feedkeys('j'->repeat(&lines), 'xnt')
EOF
)

I press C-X C-E in xterm to paste the last multiline shell command inside a Vim buffer, then ZZ to run it.

@lacygoill
Copy link
Author

Also, if we maintain l pressed, the cursor:

  • moves forward till the vertical bar
  • gets back to the beginning
  • moves forward till the vertical bar again
  • moves 8 cells forward (and stops there)

That's with &columns = 80. With &columns = 100, something similar happens; the cursor:

  • moves forward till the vertical bar
  • gets back to the beginning
  • moves forward till the vertical bar again
  • moves 32 cells forward (and stops there)

@lacygoill
Copy link
Author

gif

@lacygoill
Copy link
Author

The number of columns also affects the issue. 80 columns and 24 lines works for me:

HOME=/tmp vim -Nu NONE -i NONE -U NONE -S <(tee <<'EOF'
    vim9script
    &smoothscroll = true
    &wrap = true
    &lines = 24
    &columns = 80
    vsplit
    var text: string = 'the quick brown fox jumps over the lazy dog '
    [text->repeat(&columns / text->strcharlen() + 1)]->repeat(&lines)->setline(1)
    feedkeys('j'->repeat(&lines), 'xnt')
EOF
)

@brammool
Copy link
Contributor

brammool commented Oct 6, 2022 via email

@brammool
Copy link
Contributor

brammool commented Oct 6, 2022

I expect this to be fixed by patch 9.0.0671, please check.

@lacygoill
Copy link
Author

Yes, it is fixed as of Vim 9.0.0676, so closing.

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

No branches or pull requests

2 participants