Don't adjust viewer parameters twice after search in the hex mode.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-04-13 20:53:45 +04:00
parent 24d746ad2b
commit 1bb36fd589
2 changed files with 5 additions and 18 deletions

View File

@ -493,19 +493,15 @@ mcview_place_cursor (mcview_t * view)
void
mcview_moveto_match (mcview_t * view)
{
off_t offset;
offset = view->search_start;
if (view->hex_mode)
{
view->hex_cursor = offset;
view->dpy_start = offset - offset % view->bytes_per_line;
view->hex_cursor = view->search_start;
view->hexedit_lownibble = FALSE;
view->dpy_start = view->search_start - view->search_start % view->bytes_per_line;
view->dpy_end = view->search_end - view->search_end % view->bytes_per_line;
}
else
{
view->dpy_start = mcview_bol (view, offset, 0);
}
view->dpy_start = mcview_bol (view, view->search_start, 0);
mcview_scroll_to_cursor (view);
view->dirty++;

View File

@ -135,14 +135,6 @@ mcview_search_show_result (mcview_t * view, WDialog ** d, size_t match_len)
match_len) : 0;
view->search_end = view->search_start + match_len + nroff_len;
if (view->hex_mode)
{
view->hex_cursor = view->search_start;
view->hexedit_lownibble = FALSE;
view->dpy_start = view->search_start - view->search_start % view->bytes_per_line;
view->dpy_end = view->search_end - view->search_end % view->bytes_per_line;
}
if (verbose)
{
dlg_run_done (*d);
@ -151,7 +143,6 @@ mcview_search_show_result (mcview_t * view, WDialog ** d, size_t match_len)
tty_refresh ();
}
mcview_moveto_match (view);
}
/* --------------------------------------------------------------------------------------------- */