To: vim_dev@googlegroups.com Subject: Patch 9.0.1612 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1612 Problem: "skipcol" not reset when using multi-byte characters. Solution: Compare with w_virtcol instead of w_cursor.col. (closes #12457) Files: src/move.c, src/testdir/test_scroll_opt.vim, src/testdir/dumps/Test_smoothscroll_multi_1.dump *** ../vim-9.0.1611/src/move.c 2023-06-05 18:41:11.757624535 +0100 --- src/move.c 2023-06-05 20:43:48.818215644 +0100 *************** *** 2414,2423 **** } check_topfill(curwin, FALSE); #endif ! // TODO: if the line doesn't fit may optimize w_skipcol ! if (curwin->w_topline == curwin->w_cursor.lnum ! && curwin->w_skipcol >= curwin->w_cursor.col) ! reset_skipcol(); if (curwin->w_topline != old_topline || curwin->w_skipcol != old_skipcol #ifdef FEAT_DIFF --- 2414,2427 ---- } check_topfill(curwin, FALSE); #endif ! if (curwin->w_topline == curwin->w_cursor.lnum) ! { ! validate_virtcol(); ! if (curwin->w_skipcol >= curwin->w_virtcol) ! // TODO: if the line doesn't fit may optimize w_skipcol instead ! // of making it zero ! reset_skipcol(); ! } if (curwin->w_topline != old_topline || curwin->w_skipcol != old_skipcol #ifdef FEAT_DIFF *** ../vim-9.0.1611/src/testdir/test_scroll_opt.vim 2023-06-05 18:41:11.757624535 +0100 --- src/testdir/test_scroll_opt.vim 2023-06-05 20:42:09.790085119 +0100 *************** *** 124,129 **** --- 124,144 ---- call StopVimInTerminal(buf) endfunc + func Test_smoothscroll_multibyte() + CheckScreendump + + let lines =<< trim END + set scrolloff=0 smoothscroll + call setline(1, [repeat('ϛ', 45), repeat('2', 36)]) + exe "normal G35l\k" + END + call writefile(lines, 'XSmoothMultibyte', 'D') + let buf = RunVimInTerminal('-S XSmoothMultibyte', #{rows: 6, cols: 40}) + call VerifyScreenDump(buf, 'Test_smoothscroll_multi_1', {}) + + call StopVimInTerminal(buf) + endfunc + func Test_smoothscroll_number() CheckScreendump *** ../vim-9.0.1611/src/testdir/dumps/Test_smoothscroll_multi_1.dump 2023-06-05 20:44:25.390252548 +0100 --- src/testdir/dumps/Test_smoothscroll_multi_1.dump 2023-06-05 20:42:41.442132040 +0100 *************** *** 0 **** --- 1,6 ---- + |ϛ+0&#ffffff0@34>ϛ@4 + @5| @34 + |2@35| @3 + |~+0#4040ff13&| @38 + |~| @38 + | +0#0000000&@21|1|,|7|1|-|3|6| @6|A|l@1| *** ../vim-9.0.1611/src/version.c 2023-06-05 19:46:14.436726710 +0100 --- src/version.c 2023-06-05 20:40:05.361845840 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1612, /**/ -- hundred-and-one symptoms of being an internet addict: 121. You ask for e-mail adresses instead of telephone numbers. /// 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 ///