To: vim_dev@googlegroups.com Subject: Patch 8.2.4154 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4154 Problem: ml_get error when exchanging windows in Visual mode. Solution: Correct end of Visual area when entering another buffer. Files: src/window.c, src/testdir/test_visual.vim *** ../vim-8.2.4153/src/window.c 2022-01-08 18:43:36.877446896 +0000 --- src/window.c 2022-01-20 13:29:36.744453905 +0000 *************** *** 1691,1696 **** --- 1691,1701 ---- (void)win_comp_pos(); // recompute window positions + if (wp->w_buffer != curbuf) + reset_VIsual_and_resel(); + else if (VIsual_active) + wp->w_cursor = curwin->w_cursor; + win_enter(wp, TRUE); redraw_all_later(NOT_VALID); } *************** *** 5332,5338 **** win_alloc_lines(win_T *wp) { wp->w_lines_valid = 0; ! wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows ); if (wp->w_lines == NULL) return FAIL; return OK; --- 5337,5343 ---- win_alloc_lines(win_T *wp) { wp->w_lines_valid = 0; ! wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows); if (wp->w_lines == NULL) return FAIL; return OK; *** ../vim-8.2.4153/src/testdir/test_visual.vim 2022-01-20 12:10:45.052814746 +0000 --- src/testdir/test_visual.vim 2022-01-20 13:21:14.540171383 +0000 *************** *** 1318,1322 **** --- 1318,1332 ---- bwipe! endfunc + " this was causing an ml_get error + func Test_visual_exchange_windows() + enew! + new + call setline(1, ['foo', 'bar']) + exe "normal G\gg\\OO\" + bwipe! + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4153/src/version.c 2022-01-20 12:44:23.523631726 +0000 --- src/version.c 2022-01-20 13:23:02.690222624 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4154, /**/ -- Q: What's orange and sounds like a parrot? A: A carrot /// 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 ///