FWIW this is what my PR (https://github.com/vim/vim/pull/11504) is attempting to fix. It fixes the logic to only move two cursors down when necessary (i.e. when the cursor would have been obscured by the <<< marker).
The previous behavior arguably was a bug, because when "set number" was set, the "<<<" is displayed on the left and wouldn't interfere with the normal display of text. The code doesn't take that into account and still has explicit logic to check for "First 3 columns from the left should move down another cursor", which would only be correct if we didn't have "set number" or foldcolumns/signs/etc. The PR adds a new function (smoothscroll_marker_overlap) which calculates the correct number of columns to move down extra cursor row so that it would work correctly for both the "set number" and "set showbreak=+++" situation. I also updated the test you added to now behave correctly. On Thu, Nov 17, 2022 at 11:01 AM Bram Moolenaar <[email protected]> wrote: > > > On 22/10/27 11:45 AM, Bram Moolenaar wrote: > > >> (got my system back from the shop; so good) > > >> > > >> Given: "xxx" is a file with a single line covering 4 screen lines > > >> Do: > > >> > > >> gvim -u NONE -U NONE xxx > > >> :set smoothscroll > > >> Ctrl-E > > >> > > >> Note that cursor starts at beginning of line, column 0. > > >> > > >> After entering Ctrl-E, observe cursor is on 2nd screen line column 0. > > >> > > >> It should be on the 1st screen line column 3, just after "<<<". > > > I thought this was nicer > > > > > I see. It also happens when "showbreak=+++", in that case skipping a > > screen line doesn't look right to me. > > Looking at the initial issue text: > > After entering Ctrl-E, observe cursor is on 2nd screen line column > 0. > It should be on the 1st screen line column 3, just after "<<<". > > I think one can argue for either to be right. Depends on what you > expect or what you think is more important. > > My opinion is that the CTRL-E command scrolls vertically. Then moving > the cursor horizontally seems wrong, it should just move up/down so that > it is in the visible part of the line. This also matters for when > scrolling in the opposite direction next, leaving the cursor in the > third screen column seems wrong to me. > > The images in pull request #11436 appear to use the option setting: > > set showbreak=+++\ > > This is a completely different situation, since after CTRL-E the cursor > can't possibly be in the first screen column. > > Currently it goes to the second screen line, while it could have been > placed in the first screen line, closer to where it was. I can't think > of a reason to move it further down, so that is something we probably > want to change. > > I'll make a test that has the wrong result, so that it's easier to fix > it and check. > > -- > The sooner you fall behind, the more time you'll have to catch up. > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net > \\\ > /// > \\\ > \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ > /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org > /// > > -- > -- > 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 on the web visit > https://groups.google.com/d/msgid/vim_dev/20221117190052.9ED771C09F7%40moolenaar.net > . > -- -- 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 on the web visit https://groups.google.com/d/msgid/vim_dev/CAHTeOx8A9hsGa8b5jn3ACL1PZ9x8sQWDO4UVcDcr4Nyp6QrNhA%40mail.gmail.com.
