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

Restoring a saved view doesn't work with long lines and a view not observing scrolloff #8654

Open
dstein64 opened this issue Jul 29, 2021 · 0 comments

Comments

@dstein64
Copy link
Contributor

dstein64 commented Jul 29, 2021

Describe the bug

Restoring a saved view doesn't work with long lines and a view not observing scrolloff (a state that can be entered through e.g., <c-d>).

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean (or gvim --clean, etc.)
  2. Edit example.txt
  3. :set lines=40
  4. :set columns=80
  5. Type <c-d><c-d>
  6. :call winrestview(winsaveview())

Expected behavior

I expected that restoring the current view wouldn't change the view. That is, I thought that winrestview(winsaveview()) would effectively be a no-op, but it resulted in the view changing (presumably to satisfy the default scrolloff=5, which became unsatisfied after pressing <c-d> twice).

Environment (please complete the following information):

  • Vim version: 8.2.2434
  • OS: Ubuntu 21.04
  • Terminal: Konsole 20.12.3
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

1 participant