mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:16:00 +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[] = {
|
BufferCommand buffer_commands[] = {
|
||||||
/* regex, function, argument */
|
/* regex, function, argument */
|
||||||
{"^gg$", bcmd_goto, { TOP } },
|
{"^gg$", bcmd_goto, { TOP } },
|
||||||
|
{"^G$", bcmd_goto, { BOTTOM } },
|
||||||
{"^[0-9]+G$", bcmd_goto, {0} },
|
{"^[0-9]+G$", bcmd_goto, {0} },
|
||||||
{"^zI$", bcmd_zoom, { ZOOM_IN } },
|
{"^zI$", bcmd_zoom, { ZOOM_IN } },
|
||||||
{"^zO$", bcmd_zoom, { ZOOM_OUT } },
|
{"^zO$", bcmd_zoom, { ZOOM_OUT } },
|
||||||
|
|
12
zathura.c
12
zathura.c
|
@ -1217,17 +1217,17 @@ void
|
||||||
bcmd_goto(char* buffer, Argument* argument)
|
bcmd_goto(char* buffer, Argument* argument)
|
||||||
{
|
{
|
||||||
int b_length = strlen(buffer);
|
int b_length = strlen(buffer);
|
||||||
|
|
||||||
if(b_length < 1)
|
if(b_length < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char* b_value = g_strndup(buffer, b_length - 1);
|
if(!strcmp(buffer, "gg"))
|
||||||
int value = atoi(b_value);
|
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();
|
update_status();
|
||||||
|
|
||||||
g_free(b_value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue