Allow cursor to be just after match if copying, GitHub issue 2602.

pull/2614/head
nicm 2021-03-09 13:07:50 +00:00
parent 81e5736510
commit 7f87280cd5
1 changed files with 5 additions and 2 deletions

View File

@ -3366,8 +3366,11 @@ window_copy_match_at_cursor(struct window_copy_mode_data *data)
cy = screen_hsize(data->backing) - data->oy + data->cy;
if (window_copy_search_mark_at(data, data->cx, cy, &at) != 0)
return (NULL);
if (data->searchmark[at] == 0)
return (NULL);
if (data->searchmark[at] == 0) {
/* Allow one position after the match. */
if (at == 0 || data->searchmark[--at] == 0)
return (NULL);
}
window_copy_match_start_end(data, at, &start, &end);
/*