[vim/vim] scroll: 'smoothscroll' position is lost when using "|" (PR #20890)

h_east (Vim Github Repository) <[email protected]> Fri, 31 Jul 2026 00:58:57 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/[email protected]>
```
Problem:  With 'smoothscroll' the scroll position in a long line is lost when
          moving to a column with "|".
Solution: Adjust the skipped columns for the column the cursor ends up in,
          not for column zero.
```

related: #20885

---

There is no issue for this, it was found while auditing the places that
reset w_skipcol, after patch 9.2.0881.

With 'smoothscroll' and a line that is longer than the window, ":norm 240|"
scrolled the window back to the start of the line.  "|" moves the cursor to
column zero first and only then to the wanted column, and beginline()
adjusts the skipped columns before that second step.

The screen dumps of Test_smooth_long_scrolloff_* are updated.  They were
made with the old behaviour, where resetting the skipped columns and
adjusting them again caused a full redraw that cleared the command line.
The text, the cursor position and the ruler are unchanged; only
":norm j721|" now stays on the command line, as it does after any other Ex
command.
You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20890

-- Commit Summary --

  * scroll: 'smoothscroll' position is lost when using "|"

-- File Changes --

    M src/normal.c (6)
    M src/testdir/dumps/Test_smooth_long_scrolloff_1.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_2.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_3.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_4.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_5.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_6.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_7.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_1.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_2.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_3.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_4.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_5.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_6.dump (2)
    M src/testdir/dumps/Test_smooth_long_scrolloff_ru_7.dump (2)
    M src/testdir/test_scroll_opt.vim (19)

-- Patch Links --

https://github.com/vim/vim/pull/20890.patch
https://github.com/vim/vim/pull/20890.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20890
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20890%40github.com.