1
1

(mcview_scroll_to_cursor): make static.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2013-01-31 10:29:59 +04:00
родитель 2f25803ce2
Коммит f6a5241e18
2 изменённых файлов: 24 добавлений и 23 удалений

Просмотреть файл

@ -295,7 +295,6 @@ void mcview_move_up (mcview_t *, off_t);
void mcview_move_down (mcview_t *, off_t);
void mcview_move_left (mcview_t *, off_t);
void mcview_move_right (mcview_t *, off_t);
void mcview_scroll_to_cursor (mcview_t *);
void mcview_moveto_top (mcview_t *);
void mcview_moveto_bottom (mcview_t *);
void mcview_moveto_bol (mcview_t *);

Просмотреть файл

@ -3,7 +3,7 @@
Functions for handle cursor movement
Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2009, 2011
2004, 2005, 2006, 2007, 2009, 2011, 2013
The Free Software Foundation, Inc.
Written by:
@ -15,7 +15,7 @@
Pavel Machek, 1998
Roland Illig <roland.illig@gmx.de>, 2004, 2005
Slava Zanko <slavazanko@google.com>, 2009
Andrew Borodin <aborodin@vmail.ru>, 2009
Andrew Borodin <aborodin@vmail.ru>, 2009, 2013
Ilia Maslakov <il.smind@gmail.com>, 2009, 2010
This file is part of the Midnight Commander.
@ -64,9 +64,31 @@
/*** file scope variables ************************************************************************/
/* --------------------------------------------------------------------------------------------- */
/*** file scope functions ************************************************************************/
/* --------------------------------------------------------------------------------------------- */
static void
mcview_scroll_to_cursor (mcview_t * view)
{
if (view->hex_mode)
{
off_t bytes = view->bytes_per_line;
off_t cursor = view->hex_cursor;
off_t topleft = view->dpy_start;
off_t displaysize;
displaysize = view->data_area.height * bytes;
if (topleft + displaysize <= cursor)
topleft = mcview_offset_rounddown (cursor, bytes) - (displaysize - bytes);
if (cursor < topleft)
topleft = mcview_offset_rounddown (cursor, bytes);
view->dpy_start = topleft;
}
}
/* --------------------------------------------------------------------------------------------- */
static void
mcview_movement_fixups (mcview_t * view, gboolean reset_search)
{
@ -277,26 +299,6 @@ mcview_move_right (mcview_t * view, off_t columns)
/* --------------------------------------------------------------------------------------------- */
void
mcview_scroll_to_cursor (mcview_t * view)
{
if (view->hex_mode)
{
const off_t bytes = view->bytes_per_line;
const off_t displaysize = view->data_area.height * bytes;
const off_t cursor = view->hex_cursor;
off_t topleft = view->dpy_start;
if (topleft + displaysize <= cursor)
topleft = mcview_offset_rounddown (cursor, bytes) - (displaysize - bytes);
if (cursor < topleft)
topleft = mcview_offset_rounddown (cursor, bytes);
view->dpy_start = topleft;
}
}
/* --------------------------------------------------------------------------------------------- */
void
mcview_moveto_top (mcview_t * view)
{