To: vim_dev@googlegroups.com Subject: Patch 8.2.5155 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5155 Problem: In diff mode windows may get out of sync. (Gary Johnson) Solution: Avoid that the other window scrolls for 'cursorbind'. Files: src/move.c, src/testdir/test_diffmode.vim, src/testdir/dumps/Test_diff_scroll_1.dump, src/testdir/dumps/Test_diff_scroll_2.dump *** ../vim-8.2.5154/src/move.c 2022-06-20 11:37:36.736346680 +0100 --- src/move.c 2022-06-24 12:34:48.738159036 +0100 *************** *** 2952,2958 **** restart_edit_save = restart_edit; restart_edit = TRUE; check_cursor(); ! validate_cursor(); restart_edit = restart_edit_save; // Correct cursor for multi-byte character. if (has_mbyte) --- 2952,2963 ---- restart_edit_save = restart_edit; restart_edit = TRUE; check_cursor(); ! ! // Avoid a scroll here for the cursor position, 'scrollbind' is ! // more important. ! if (!curwin->w_p_scb) ! validate_cursor(); ! restart_edit = restart_edit_save; // Correct cursor for multi-byte character. if (has_mbyte) *** ../vim-8.2.5154/src/testdir/test_diffmode.vim 2022-03-06 19:53:52.719203716 +0000 --- src/testdir/test_diffmode.vim 2022-06-24 12:33:52.054314599 +0100 *************** *** 1535,1538 **** --- 1535,1607 ---- set scrollbind& endfunc + " This was scrolling for 'cursorbind' but 'scrollbind' is more important + func Test_diff_scroll() + CheckScreendump + + let left =<< trim END + line 1 + line 2 + line 3 + line 4 + + // Common block + // one + // containing + // four lines + + // Common block + // two + // containing + // four lines + END + call writefile(left, 'Xleft') + let right =<< trim END + line 1 + line 2 + line 3 + line 4 + + Lorem + ipsum + dolor + sit + amet, + consectetur + adipiscing + elit. + Etiam + luctus + lectus + sodales, + dictum + + // Common block + // one + // containing + // four lines + + Vestibulum + tincidunt + aliquet + nulla. + + // Common block + // two + // containing + // four lines + END + call writefile(right, 'Xright') + let buf = RunVimInTerminal('-d Xleft Xright', {'rows': 12}) + call term_sendkeys(buf, "\\jjjj") + call VerifyScreenDump(buf, 'Test_diff_scroll_1', {}) + call term_sendkeys(buf, "j") + call VerifyScreenDump(buf, 'Test_diff_scroll_2', {}) + + call StopVimInTerminal(buf) + call delete('Xleft') + call delete('Xright') + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.5154/src/testdir/dumps/Test_diff_scroll_1.dump 2022-06-24 12:38:11.622205949 +0100 --- src/testdir/dumps/Test_diff_scroll_1.dump 2022-06-24 12:35:07.862107085 +0100 *************** *** 0 **** --- 1,12 ---- + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |1| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |1| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |2| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |2| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |3| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |3| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |4| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |4| @28 + | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@34 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|L+0#0000000#5fd7ff255|o|r|e|m| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|p|s|u|m| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|d+0#0000000#5fd7ff255|o|l|o|r| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|i|t| @31 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|m|e|t|,| @29 + |X+1&#ffffff0|l|e|f|t| @13|5|,|0|-|1| @9|T|o|p| |X+3&&|r|i|g|h|t| @12|5|,|0|-|1| @9|T|o|p + |"+0&&|X|r|i|g|h|t|"| |3@1|L|,| |2|6|3|B| @56 *** ../vim-8.2.5154/src/testdir/dumps/Test_diff_scroll_2.dump 2022-06-24 12:38:11.626205959 +0100 --- src/testdir/dumps/Test_diff_scroll_2.dump 2022-06-24 12:35:09.026103932 +0100 *************** *** 0 **** --- 1,12 ---- + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |1| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |1| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |2| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |2| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |3| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |3| @28 + | +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |4| @28||+1&&| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |4| @28 + | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1>L+0#0000000#5fd7ff255|o|r|e|m| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|p|s|u|m| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|d+0#0000000#5fd7ff255|o|l|o|r| @29 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|i|t| @31 + | +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|m|e|t|,| @29 + |X+1&#ffffff0|l|e|f|t| @13|6|,|1| @11|T|o|p| |X+3&&|r|i|g|h|t| @12|6|,|1| @11|T|o|p + |"+0&&|X|r|i|g|h|t|"| |3@1|L|,| |2|6|3|B| @56 *** ../vim-8.2.5154/src/version.c 2022-06-23 20:46:15.092705516 +0100 --- src/version.c 2022-06-24 12:14:00.427051181 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 5155, /**/ -- Engineers understand that their appearance only bothers other people and therefore it is not worth optimizing. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///