Patch 8.2.2911
Problem:    Pattern "\%V" does not match all of block selection. (Rick Howe)
Solution:   Use the value of vi_curswant. (closes #8285)
Files:      src/regexp.c, src/testdir/test_search.vim,
            src/testdir/dumps/Test_hlsearch_block_visual_match.dump


*** ../vim-8.2.2910/src/regexp.c        2021-04-19 16:48:44.435055499 +0200
--- src/regexp.c        2021-05-30 16:25:05.737344036 +0200
***************
*** 1279,1284 ****
--- 1279,1285 ----
      colnr_T   start, end;
      colnr_T   start2, end2;
      colnr_T   cols;
+     colnr_T   curswant;
  
      // Check if the buffer is the current buffer.
      if (rex.reg_buf != curbuf || VIsual.lnum == 0)
***************
*** 1297,1302 ****
--- 1298,1304 ----
            bot = VIsual;
        }
        mode = VIsual_mode;
+       curswant = wp->w_curswant;
      }
      else
      {
***************
*** 1311,1316 ****
--- 1313,1319 ----
            bot = curbuf->b_visual.vi_start;
        }
        mode = curbuf->b_visual.vi_mode;
+       curswant = curbuf->b_visual.vi_curswant;
      }
      lnum = rex.lnum + rex.reg_firstlnum;
      if (lnum < top.lnum || lnum > bot.lnum)
***************
*** 1331,1337 ****
            start = start2;
        if (end2 > end)
            end = end2;
!       if (top.col == MAXCOL || bot.col == MAXCOL)
            end = MAXCOL;
        cols = win_linetabsize(wp, rex.line, (colnr_T)(rex.input - rex.line));
        if (cols < start || cols > end - (*p_sel == 'e'))
--- 1334,1340 ----
            start = start2;
        if (end2 > end)
            end = end2;
!       if (top.col == MAXCOL || bot.col == MAXCOL || curswant == MAXCOL)
            end = MAXCOL;
        cols = win_linetabsize(wp, rex.line, (colnr_T)(rex.input - rex.line));
        if (cols < start || cols > end - (*p_sel == 'e'))
*** ../vim-8.2.2910/src/testdir/test_search.vim 2021-05-24 22:56:10.110989235 
+0200
--- src/testdir/test_search.vim 2021-05-30 16:40:27.947066087 +0200
***************
*** 984,989 ****
--- 984,1009 ----
    call delete('Xhlvisual_script')
  endfunc
  
+ func Test_hlsearch_block_visual_match()
+   CheckScreendump
+ 
+   let lines =<< trim END
+     set hlsearch
+     call setline(1, ['aa', 'bbbb', 'cccccc'])
+   END
+   call writefile(lines, 'Xhlsearch_block')
+   let buf = RunVimInTerminal('-S Xhlsearch_block', {'rows': 9, 'cols': 60})
+ 
+   call term_sendkeys(buf, "G\<C-V>$kk\<Esc>")
+   sleep 100m
+   call term_sendkeys(buf, "/\\%V\<CR>")
+   sleep 100m
+   call VerifyScreenDump(buf, 'Test_hlsearch_block_visual_match', {})
+ 
+   call StopVimInTerminal(buf)
+   call delete('Xhlsearch_block')
+ endfunc
+ 
  func Test_incsearch_substitute()
    CheckOption incsearch
  
*** ../vim-8.2.2910/src/testdir/dumps/Test_hlsearch_block_visual_match.dump     
2021-05-30 16:42:19.074780757 +0200
--- src/testdir/dumps/Test_hlsearch_block_visual_match.dump     2021-05-30 
16:40:40.611033637 +0200
***************
*** 0 ****
--- 1,9 ----
+ |a+0&#ffff4012@1| | +0&#ffffff0@56
+ >b+0&#ffff4012@3| | +0&#ffffff0@54
+ |c+0&#ffff4012@5| | +0&#ffffff0@52
+ |~+0#4040ff13&| @58
+ |~| @58
+ |~| @58
+ |~| @58
+ |~| @58
+ |/+0#0000000&|\|%|V| @37|2|,|1| @10|A|l@1| 
*** ../vim-8.2.2910/src/version.c       2021-05-30 14:21:53.852508536 +0200
--- src/version.c       2021-05-30 16:26:39.417125591 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2911,
  /**/

-- 
TIM: But follow only if you are men of valour.  For the entrance to this cave
     is guarded by a monster, a creature so foul and cruel that no man yet has
     fought with it and lived.  Bones of full fifty men lie strewn about its
     lair ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@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    ///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202105301443.14UEhoS71800149%40masaka.moolenaar.net.

Raspunde prin e-mail lui