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)
bot = VIsual;
}
mode = VIsual_mode;
+ curswant = wp->w_curswant;
}
else
{
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)
start = start2;
if (end2 > end)
end = end2;
- if (top.col == MAXCOL || bot.col == MAXCOL)
+ 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'))
--- /dev/null
+|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|
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2911,
/**/
2910,
/**/