To: vim_dev@googlegroups.com Subject: Patch 8.1.2314 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2314 Problem: vi' sometimes does not select anything. Solution: Recognize an empty selection. (Christian Brabandt, closes #5183) Files: src/search.c, src/testdir/test_textobjects.vim *** ../vim-8.1.2313/src/search.c 2019-11-17 17:06:25.828081709 +0100 --- src/search.c 2019-11-17 17:28:12.404623475 +0100 *************** *** 4434,4442 **** return FALSE; vis_bef_curs = LT_POS(VIsual, curwin->w_cursor); if (*p_sel == 'e') { ! if (!vis_bef_curs) { // VIsual needs to be the start of Visual selection. pos_T t = curwin->w_cursor; --- 4434,4443 ---- return FALSE; vis_bef_curs = LT_POS(VIsual, curwin->w_cursor); + vis_empty = EQUAL_POS(VIsual, curwin->w_cursor); if (*p_sel == 'e') { ! if (!vis_bef_curs && !vis_empty) { // VIsual needs to be the start of Visual selection. pos_T t = curwin->w_cursor; *************** *** 4447,4454 **** restore_vis_bef = TRUE; } dec_cursor(); } - vis_empty = EQUAL_POS(VIsual, curwin->w_cursor); } if (!vis_empty) --- 4448,4455 ---- restore_vis_bef = TRUE; } dec_cursor(); + vis_empty = EQUAL_POS(VIsual, curwin->w_cursor); } } if (!vis_empty) *** ../vim-8.1.2313/src/testdir/test_textobjects.vim 2019-06-15 17:57:43.976724009 +0200 --- src/testdir/test_textobjects.vim 2019-11-17 17:28:12.408623493 +0100 *************** *** 47,52 **** --- 47,55 ---- set selection=exclusive exe "norm! fdvhi'y" call assert_equal('bcde', @") + let @"='dummy' + exe "norm! $gevi'y" + call assert_equal('bcde', @") set selection&vim bw! endfunc *** ../vim-8.1.2313/src/version.c 2019-11-17 17:06:25.828081709 +0100 --- src/version.c 2019-11-17 17:30:19.193141869 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2314, /**/ -- From "know your smileys": 8<}} Glasses, big nose, beard /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///