On 2015-08-11, Christian Brabandt wrote: > It seems like I forgot to reply to this message. > > On Do, 06 Aug 2015, Gary Johnson wrote: > > > On 2015-08-06, Christian Brabandt wrote: > > > Hi Gary! > > > > > > On Mi, 05 Aug 2015, Gary Johnson wrote: > > > > > > > The command zt, which scrolls the current line to the top of the > > > > screen, does not always work in a window that's in diff mode. > > > > Depending on the line that the cursor is on, it either works > > > > correctly, scrolls the current line part way up the screen, or has > > > > no effect at all. > > > > > > > > Here is an example, using terminal vim in a 24-line terminal (xterm) > > > > window. > > > > > > > > $ vimdiff -N -u NONE <(seq 30; seq 61 90) <(seq 90) > > > > 31G > > > > > > > > The cursor is on the line with the text "61" and at the bottom of > > > > the screen. Type > > > > > > > > zt > > > > > > > > The left window now looks like this, with cursor still on the "61" > > > > line. This is not the behavior I would expect and seems wrong. > > > > > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > -------------------------------------- > > > > 61 > > > > 62 > > > > 63 > > > > 64 > > > > 65 > > > > 66 > > > > + +-- 24 lines: 67-------------------- > > > > > > > > Type > > > > > > > > zt > > > > > > > > again. There is no change. Now move the cursor to the line with > > > > "62" and repeat: > > > > > > > > j > > > > zt > > > > > > > > There is still no change to the window. Now move the cursor to the > > > > next line, containing "63" and repeat: > > > > > > > > j > > > > zt > > > > > > > > This time, that line is put at the top of the screen as one would > > > > expect. The window now looks like this, as I would expect. > > > > > > > > 63 > > > > 64 > > > > 65 > > > > 66 > > > > + +-- 24 lines: 67-------------------- > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > ~ > > > > > > > > Moving the cursor up a line with k redraws the screen to look as in > > > > the first illustration above. This also seems wrong. > > > > > > > > I am using Vim 7.4.808 in an xterm on a system running Fedora 17 > > > > Linux. FWIW, the behavior is the same in 7.3.444, so this is not > > > > new. > > > > > > Here is a patch. > > > > Thanks for the patch, but it doesn't seem to have any effect at all > > on the behavior reported above. > > Okay, let me clarify the difference. Take a window with large enough > number of rows, I used 40 Lines with your provided commandline. > > $ ./vim -Nd -u NONE -c '31' <(seq 30; seq 61 90) <(seq 90) > > Current behaviour of Vim, once you pressed 'zt' on Line with the 61 in > it, the window will look like this: > > Current behaviour: > ,----[left Vim window] > | 30 > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | [many more] > | -------------------------------------- > | 61 > | 62 > | ... > `---- > > Original patch: > ,----[left Vim window] > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | -------------------------------------- > | [many more] > | -------------------------------------- > | 61 > | 62 > | ... > `---- > > Remove the comment in move.c > /* i = diff_check_fill(curwin, curwin->w_cursor.lnum); */ > ,----[left Vim window] > | 61 > | 62 > | ... > `---- > > So whatever seems to be suited best, should be used. I don't really > care, although I slightly prefer the last behaviour. So I left the > comment with a note inside the patch. Bram can decide. > > I think, this should clarify, right?
I had deliberately chosen the arguments to seq to illustrate my point when running in a "standard" 80x24 terminal, but I neglected to state that. When I ran the test in such a terminal, your patch made no difference at all. I assumed that you had made a mistake or that I had not described the problem clearly, so I didn't even try removing the comment. When I read your comment today about a 40-line terminal, and ran your test with and without your patch, I did see the difference and decided to try the uncommented version. _That_ is the behavior I want! When I type 'zt' I want the current line to go to the top of the window. Period. Thanks so much for the patch and your patience. I hope Bram will include the version with that line uncommented. Regards, Gary -- -- 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]. For more options, visit https://groups.google.com/d/optout.
