[elinks-dev] [PATCH 2/2] Add a function to put the current line at the top of the screen
Signed-off-by: Fabienne Ducroquet fabi...@gmail.com --- src/config/actions-main.inc | 1 + src/viewer/action.c | 4 src/viewer/text/view.c | 6 ++ src/viewer/text/view.h | 1 + 4 files changed, 12 insertions(+) diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index 5f686b2..abe6fa6 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -53,6 +53,7 @@ ACTION_(MAIN, lua-console, LUA_CONSOLE, N__(Open a Lua console), ACTION_REST ACTION_(MAIN, mark-goto, MARK_GOTO, N__(Go at a specified mark), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, mark-set, MARK_SET, N__(Set a mark), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, menu, MENU, N__(Activate the menu), 0), +ACTION_(MAIN, move-current-top, MOVE_CURRENT_TOP, N__(Move downwards to put the current line at the top), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-cursor-down, MOVE_CURSOR_DOWN, N__(Move cursor down), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-cursor-left, MOVE_CURSOR_LEFT, N__(Move cursor left), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-cursor-line-start, MOVE_CURSOR_LINE_START, N__(Move cursor to the start of the line), ACTION_REQUIRE_VIEW_STATE), diff --git a/src/viewer/action.c b/src/viewer/action.c index 77280e6..6d15e33 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -335,6 +335,10 @@ do_action(struct session *ses, enum main_action action_id, int verbose) activate_bfu_technology(ses, -1); break; + case ACT_MAIN_MOVE_CURRENT_TOP: + status = move_current_top(ses, doc_view); + break; + case ACT_MAIN_MOVE_CURSOR_UP: status = move_cursor_up(ses, doc_view); break; diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 8eb422d..943bd33 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -138,6 +138,12 @@ move_half_page_down(struct session *ses, struct document_view *doc_view) return move_part_page_down(ses, doc_view, doc_view-box.height / 2); } +enum frame_event_status +move_current_top(struct session *ses, struct document_view *doc_view) +{ + return move_part_page_down(ses, doc_view, doc_view-box.height - ses-tab-y + 1); +} + /*! @a type == 0 - PAGE_UP; * @a type == 1 - UP */ static void diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h index d7721b1..7c11260 100644 --- a/src/viewer/text/view.h +++ b/src/viewer/text/view.h @@ -14,6 +14,7 @@ struct terminal; * But doesn't free() the @a doc_view. */ void detach_formatted(struct document_view *doc_view); +enum frame_event_status move_current_top(struct session *ses, struct document_view *doc_view); enum frame_event_status move_half_page_down(struct session *ses, struct document_view *doc_view); enum frame_event_status move_half_page_up(struct session *ses, struct document_view *doc_view); enum frame_event_status move_page_down(struct session *ses, struct document_view *doc_view); -- 1.8.5.1 ___ elinks-dev mailing list elinks-dev@linuxfromscratch.org http://linuxfromscratch.org/mailman/listinfo/elinks-dev
[elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions
I didn’t follow the right order when I added the functions to move up and down by half a page a few years ago. Signed-off-by: Fabienne Ducroquet fabi...@gmail.com --- src/config/actions-main.inc | 4 ++-- src/viewer/action.c | 16 src/viewer/text/view.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index cb6c6bb..5f686b2 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -60,6 +60,8 @@ ACTION_(MAIN, move-cursor-right, MOVE_CURSOR_RIGHT, N__(Move cursor right), ACTION_(MAIN, move-cursor-up, MOVE_CURSOR_UP, N__(Move cursor up), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-document-end, MOVE_DOCUMENT_END, N__(Move to the end of the document), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-document-start, MOVE_DOCUMENT_START, N__(Move to the start of the document), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, move-half-page-down, MOVE_HALF_PAGE_DOWN, N__(Move downwards by half a page), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, move-half-page-up, MOVE_HALF_PAGE_UP, N__(Move upwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-down, MOVE_LINK_DOWN, N__(Move one link down), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-down-line, MOVE_LINK_DOWN_LINE, N__(Move to the next line with a link), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-left, MOVE_LINK_LEFT, N__(Move one link left), ACTION_REQUIRE_VIEW_STATE), @@ -71,9 +73,7 @@ ACTION_(MAIN, move-link-right-line, MOVE_LINK_RIGHT_LINE, N__(Move one link r ACTION_(MAIN, move-link-up, MOVE_LINK_UP, N__(Move one link up), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-up-line, MOVE_LINK_UP_LINE, N__(Move to the previous line with a link), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-page-down, MOVE_PAGE_DOWN, N__(Move downwards by a page), ACTION_REQUIRE_VIEW_STATE), -ACTION_(MAIN, move-half-page-down, MOVE_HALF_PAGE_DOWN, N__(Move downwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-page-up, MOVE_PAGE_UP, N__(Move upwards by a page), ACTION_REQUIRE_VIEW_STATE), -ACTION_(MAIN, move-half-page-up, MOVE_HALF_PAGE_UP, N__(Move upwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, open-link-in-new-tab, OPEN_LINK_IN_NEW_TAB, N__(Open the current link in a new tab), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), ACTION_(MAIN, open-link-in-new-tab-in-background, OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__(Open the current link in a new tab in the background), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), ACTION_(MAIN, open-link-in-new-window, OPEN_LINK_IN_NEW_WINDOW, N__(Open the current link in a new window), ACTION_RESTRICT_ANONYMOUS | ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), diff --git a/src/viewer/action.c b/src/viewer/action.c index 402c4e1..77280e6 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -355,6 +355,14 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_cursor_line_start(ses, doc_view); break; + case ACT_MAIN_MOVE_HALF_PAGE_DOWN: + status = move_half_page_down(ses, doc_view); + break; + + case ACT_MAIN_MOVE_HALF_PAGE_UP: + status = move_half_page_up(ses, doc_view); + break; + case ACT_MAIN_MOVE_LINK_DOWN: status = move_link_down(ses, doc_view); break; @@ -399,18 +407,10 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_page_down(ses, doc_view); break; - case ACT_MAIN_MOVE_HALF_PAGE_DOWN: - status = move_half_page_down(ses, doc_view); - break; - case ACT_MAIN_MOVE_PAGE_UP: status = move_page_up(ses, doc_view); break; - case ACT_MAIN_MOVE_HALF_PAGE_UP: - status = move_half_page_up(ses, doc_view); - break; - case ACT_MAIN_MOVE_DOCUMENT_START: status = move_document_start(ses, doc_view); break; diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h index f7032f2..d7721b1 100644 --- a/src/viewer/text/view.h +++ b/src/viewer/text/view.h @@ -14,10 +14,10 @@ struct terminal; * But doesn't free() the @a doc_view. */ void detach_formatted(struct document_view *doc_view); -enum frame_event_status move_page_down(struct session *ses, struct document_view *doc_view); enum frame_event_status move_half_page_down(struct session *ses, struct document_view *doc_view); -enum frame_event_status move_page_up(struct session *ses,
[elinks-dev] [PATCH] elinks.conf.5, elinkskeys.5: Document undocumented features
I should have done that when I added them, mea culpa. Signed-off-by: Fabienne Ducroquet fabi...@gmail.com --- doc/man/man5/elinks.conf.5 | 5 + doc/man/man5/elinkskeys.5 | 15 +++ 2 files changed, 20 insertions(+) diff --git a/doc/man/man5/elinks.conf.5 b/doc/man/man5/elinks.conf.5 index 54f5fd8..f6c54d4 100644 --- a/doc/man/man5/elinks.conf.5 +++ b/doc/man/man5/elinks.conf.5 @@ -591,6 +591,11 @@ document\.browse\.scrolling\.margin \fBnum\fR (default: 3) Size of the virtual margin \(en when you click inside of that margin, document scrolls in that direction\. .RE .PP +document\.browse\.scrolling\.vertical_overlap \fBnum\fR (default: 0) +.RS 4 +Number of overlapping lines between the new page displayed and the previous one when scrolling one page up or down\. +.RE +.PP document\.browse\.scrolling\.vertical_step \fBnum\fR (default: 2) .RS 4 Number of lines to scroll when a key bound to scroll\-up or scroll\-down is pressed and no prefix was given\. diff --git a/doc/man/man5/elinkskeys.5 b/doc/man/man5/elinkskeys.5 index 5aa39d1..ccec90e 100644 --- a/doc/man/man5/elinkskeys.5 +++ b/doc/man/man5/elinkskeys.5 @@ -324,6 +324,11 @@ menu Activate the menu\. .RE .PP +move\-current\-top +.RS 4 +Move downwards to put the current line at the top of the screen\. +.RE +.PP move\-cursor\-down .RS 4 Move cursor down\. @@ -359,6 +364,16 @@ move\-document\-start Move to the start of the document\. .RE .PP +move\-half\-page\-down +.RS 4 +Move downwards by half a page\. +.RE +.PP +move\-half\-page\-up +.RS 4 +Move upwards by half a page\. +.RE +.PP move\-link\-down .RS 4 Move one link down\. -- 1.8.5.1 ___ elinks-dev mailing list elinks-dev@linuxfromscratch.org http://linuxfromscratch.org/mailman/listinfo/elinks-dev
Re: [elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions
Sorry, I aplied patch1 before patch0. Could you prepare new patch with correct order of functions? ___ elinks-dev mailing list elinks-dev@linuxfromscratch.org http://linuxfromscratch.org/mailman/listinfo/elinks-dev
Re: [elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions
I didn’t respect the right order when I added the functions to move up and down by half a page a few years ago. Signed-off-by: Fabienne Ducroquet fabi...@gmail.com --- Le mercredi 18 décembre 2013, Witold Filipczyk a écrit : Sorry, I aplied patch1 before patch0. Could you prepare new patch with correct order of functions? That one applies after the one adding move-current-top. src/config/actions-main.inc | 4 ++-- src/viewer/action.c | 16 src/viewer/text/view.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index 2e90ddc..abe6fa6 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -61,6 +61,8 @@ ACTION_(MAIN, move-cursor-right, MOVE_CURSOR_RIGHT, N__(Move cursor right), ACTION_(MAIN, move-cursor-up, MOVE_CURSOR_UP, N__(Move cursor up), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-document-end, MOVE_DOCUMENT_END, N__(Move to the end of the document), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-document-start, MOVE_DOCUMENT_START, N__(Move to the start of the document), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, move-half-page-down, MOVE_HALF_PAGE_DOWN, N__(Move downwards by half a page), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, move-half-page-up, MOVE_HALF_PAGE_UP, N__(Move upwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-down, MOVE_LINK_DOWN, N__(Move one link down), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-down-line, MOVE_LINK_DOWN_LINE, N__(Move to the next line with a link), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-left, MOVE_LINK_LEFT, N__(Move one link left), ACTION_REQUIRE_VIEW_STATE), @@ -72,9 +74,7 @@ ACTION_(MAIN, move-link-right-line, MOVE_LINK_RIGHT_LINE, N__(Move one link r ACTION_(MAIN, move-link-up, MOVE_LINK_UP, N__(Move one link up), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-link-up-line, MOVE_LINK_UP_LINE, N__(Move to the previous line with a link), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-page-down, MOVE_PAGE_DOWN, N__(Move downwards by a page), ACTION_REQUIRE_VIEW_STATE), -ACTION_(MAIN, move-half-page-down, MOVE_HALF_PAGE_DOWN, N__(Move downwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, move-page-up, MOVE_PAGE_UP, N__(Move upwards by a page), ACTION_REQUIRE_VIEW_STATE), -ACTION_(MAIN, move-half-page-up, MOVE_HALF_PAGE_UP, N__(Move upwards by half a page), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, open-link-in-new-tab, OPEN_LINK_IN_NEW_TAB, N__(Open the current link in a new tab), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), ACTION_(MAIN, open-link-in-new-tab-in-background, OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__(Open the current link in a new tab in the background), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), ACTION_(MAIN, open-link-in-new-window, OPEN_LINK_IN_NEW_WINDOW, N__(Open the current link in a new window), ACTION_RESTRICT_ANONYMOUS | ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK), diff --git a/src/viewer/action.c b/src/viewer/action.c index d33a4c8..6d15e33 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -359,6 +359,14 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_cursor_line_start(ses, doc_view); break; + case ACT_MAIN_MOVE_HALF_PAGE_DOWN: + status = move_half_page_down(ses, doc_view); + break; + + case ACT_MAIN_MOVE_HALF_PAGE_UP: + status = move_half_page_up(ses, doc_view); + break; + case ACT_MAIN_MOVE_LINK_DOWN: status = move_link_down(ses, doc_view); break; @@ -403,18 +411,10 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_page_down(ses, doc_view); break; - case ACT_MAIN_MOVE_HALF_PAGE_DOWN: - status = move_half_page_down(ses, doc_view); - break; - case ACT_MAIN_MOVE_PAGE_UP: status = move_page_up(ses, doc_view); break; - case ACT_MAIN_MOVE_HALF_PAGE_UP: - status = move_half_page_up(ses, doc_view); - break; - case ACT_MAIN_MOVE_DOCUMENT_START: status = move_document_start(ses, doc_view); break; diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h index d560bb5..7c11260 100644 --- a/src/viewer/text/view.h +++ b/src/viewer/text/view.h @@ -15,10 +15,10 @@ struct terminal; void detach_formatted(struct document_view *doc_view); enum frame_event_status move_current_top(struct session *ses, struct