Ticket #2294: mcview: incorrect starting offset for 'search again'

When you press F7 in mcview to repeat the previous search, it starts again from the
file offset that is 3 bytes after the beginning of the current match. This introduces
weird and clearly buggy symptoms. Couple of examples:
If the file contains

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

and you search for a single x character, and you keep on pressing F7,
every third character gets highlighted.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Egmont Koblinger 2011-06-29 17:49:58 +03:00 committed by Slava Zanko
parent 906f688742
commit ff2132b0a8

View File

@ -228,7 +228,7 @@ mcview_do_search (mcview_t * view)
if (view->search_start)
{
search_start = (mcview_search_options.backwards) ? -2 : 2;
search_start = (mcview_search_options.backwards) ? -2 : 0;
search_start = view->search_start + search_start +
mcview__get_nroff_real_len (view, view->search_start, 2) * search_start;
}