mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-27 13:46:01 +01:00
Jump to begin/end/page
This commit is contained in:
parent
85beb0d242
commit
2d13e10898
2 changed files with 7 additions and 6 deletions
|
@ -87,6 +87,7 @@ Command commands[] = {
|
|||
BufferCommand buffer_commands[] = {
|
||||
/* regex, function, argument */
|
||||
{"^gg$", bcmd_goto, { TOP } },
|
||||
{"^G$", bcmd_goto, { BOTTOM } },
|
||||
{"^[0-9]+G$", bcmd_goto, {0} },
|
||||
{"^zI$", bcmd_zoom, { ZOOM_IN } },
|
||||
{"^zO$", bcmd_zoom, { ZOOM_OUT } },
|
||||
|
|
12
zathura.c
12
zathura.c
|
@ -1217,17 +1217,17 @@ void
|
|||
bcmd_goto(char* buffer, Argument* argument)
|
||||
{
|
||||
int b_length = strlen(buffer);
|
||||
|
||||
if(b_length < 1)
|
||||
return;
|
||||
|
||||
char* b_value = g_strndup(buffer, b_length - 1);
|
||||
int value = atoi(b_value);
|
||||
if(!strcmp(buffer, "gg"))
|
||||
set_page(0);
|
||||
else if(!strcmp(buffer, "G"))
|
||||
set_page(Zathura.PDF.number_of_pages - 1);
|
||||
else
|
||||
set_page(atoi(g_strndup(buffer, b_length - 1)) - 1);
|
||||
|
||||
set_page(value - 1);
|
||||
update_status();
|
||||
|
||||
g_free(b_value);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue