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 bug in vertical split #4245

Open
yalpul opened this issue Apr 12, 2019 · 1 comment
Open

Cursor bug in vertical split #4245

yalpul opened this issue Apr 12, 2019 · 1 comment

Comments

@yalpul
Copy link

yalpul commented Apr 12, 2019

On vertical split mode with 2 windows, cursor doesn't show in the line immediately below when the command o is given or immediately above when O is given. This happens when one of the lines is spanning the whole horizontal space while at the same time line count is going from 99 to 100 (as a result of o). This happens when the window is either at the left side or right side in vertical split. It does not occur when there is only one window(no vertical split).

Detailed steps to reproduce the behavior:

  1. Run vim --clean (or gvim --clean, etc.)
  2. Enter :set number and :set numberwidth=2
  3. Edit file1
  4. Fill the file with 99 lines
  5. Use :vsp file2 to vertically split the window (content of file2 is irrelevant)
  6. In file1, fill one of the lines up to the point where the line is spanning the whole horizontal space(vertical split bar will be the bound)
  7. In file1 hit o or O. Cursor will be on the wrong place. When started typing, it writes correctly.

Expected behavior
Cursor being on the correct place, the line immediately below (or above).

Screenshots
Screen Shot 2019-04-12 at 21 08 54
hit o (cursor is on 2)
Screen Shot 2019-04-12 at 21 09 20
start typing
Screen Shot 2019-04-12 at 21 09 32

Environment

  • Vim version 8.0.1453(Ubuntu) and version 8.0.1283(macOS)
    Edit: reproducable in version 8.1.1161
  • OS: Ubuntu 18.04 and macOS 10.14.4
  • Terminal: Apple Terminal App

Additional context
Basically, key points of the bug are:

  • Vertical split
  • numberwidth=2
  • line count going from 99 to 100
  • one long line about to overflow to 2 lines
@Ruteri
Copy link

Ruteri commented May 31, 2019

I have reproduced it in a slightly easier setup:

  • happens without the split
  • 9 lines are enough, I think what matters is the change of number of columns needed for line numbering
  • does not happen when numberwidth is larger than number of columns required for numbering after the new line (e.g. for change 9->10 lines does not happen with numberwidth > 2, for 99->100 with numberwidth > 3), as the number of columns for numbering does not change

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