Commit d6574f57 authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Open command with appended current filepath

Closes #30

Thanks to thorsten
parent cd08c8be
......@@ -104,6 +104,7 @@ Shortcut shortcuts[] = {
{GDK_SHIFT_MASK, GDK_question, sc_focus_inputbar, NORMAL, { .data = "?" } },
{0, GDK_colon, sc_focus_inputbar, NORMAL, { .data = ":" } },
{0, GDK_o, sc_focus_inputbar, NORMAL, { .data = ":open " } },
{0, GDK_O, sc_focus_inputbar, NORMAL, { APPEND_FILEPATH, .data = ":open " } },
{0, GDK_f, sc_follow, NORMAL, {0} },
{0, GDK_J, sc_navigate, NORMAL, { NEXT } },
{0, GDK_K, sc_navigate, NORMAL, { PREVIOUS } },
......
......@@ -28,7 +28,7 @@ enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT,
BACKWARD, ADJUST_BESTFIT, ADJUST_WIDTH, ADJUST_NONE, CONTINUOUS, DELETE_LAST,
ADD_MARKER, EVAL_MARKER, EXPAND, COLLAPSE, SELECT, GOTO_DEFAULT, GOTO_LABELS,
GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, FULL_DOWN, NEXT_CHAR, PREVIOUS_CHAR,
DELETE_TO_LINE_START };
DELETE_TO_LINE_START, APPEND_FILEPATH };
/* define modes */
#define ALL (1 << 0)
......@@ -1989,7 +1989,15 @@ sc_focus_inputbar(Argument* argument)
if(argument->data)
{
notify(DEFAULT, argument->data);
char* data = argument->data;
if(argument->n == APPEND_FILEPATH)
data = g_strdup_printf("%s%s", data, Zathura.PDF.file);
else
data = g_strdup(data);
notify(DEFAULT, data);
g_free(data);
gtk_widget_grab_focus(GTK_WIDGET(Zathura.UI.inputbar));
gtk_editable_set_position(GTK_EDITABLE(Zathura.UI.inputbar), -1);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment