From 02af6696f537a24d41a5a1fc510b6d29f8244899 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 12 Aug 2007 10:34:00 +0200 Subject: [PATCH] actions: Fixed moving in frames. (cherry picked from commit 2045574edca170a47b1e9f1e05cd210bdae8a49a) --- src/viewer/text/view.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 4632fa40..8ab1b25e 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -169,6 +169,7 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; + struct box *box; struct link *link, *last = NULL; int y1, y, min_x, max_x, x1; @@ -178,10 +179,10 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) vs = doc_view->vs; document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; + box = &doc_view->box; - y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); - x1 = vs->x + ses->tab->x; + y = y1 = vs->y + ses->tab->y - box->y; + x1 = vs->x + ses->tab->x - box->x; link = get_current_link(doc_view); if (link) { @@ -212,6 +213,7 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; + struct box *box; struct link *link, *last = NULL; int y1, y, min_x, max_x, x1; @@ -221,10 +223,10 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) vs = doc_view->vs; document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; + box = &doc_view->box; - y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); - x1 = vs->x + ses->tab->x; + y = y1 = vs->y + ses->tab->y - box->y; + x1 = vs->x + ses->tab->x - box->x; link = get_current_link(doc_view); if (link) { @@ -684,6 +686,7 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ { struct document *document; struct view_state *vs; + struct box *box; int y, y1; assert(ses && doc_view && doc_view->vs && doc_view->document); @@ -692,8 +695,8 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; - y1 = vs->y + ses->tab->y - ses->status.show_status_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); + box = &doc_view->box; + y1 = vs->y + ses->tab->y - box->y; y = y1 + dir_y; if (dir_y < 0) int_upper_bound(&y, document->height - 1);