Commit 5780a992 authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Print target selection


Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 50ec6192
......@@ -580,9 +580,13 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
girara_setting_get(zathura->ui.session, "selection-notification", &notification);
if (notification == true) {
char* target = NULL;
girara_setting_get(zathura->ui.session, "selection-clipboard", &target);
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
char* escaped_text = g_markup_printf_escaped(
_("Copied selected text to clipboard: %s"), stripped_text);
_("Copied selected text to selection %s: %s"), target, stripped_text);
g_free(target);
g_free(stripped_text);
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
......
......@@ -229,11 +229,15 @@ GdkAtom* get_selection(zathura_t* zathura)
{
g_return_val_if_fail(zathura != NULL, NULL);
char* value;
char* value = NULL;
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
if (value == NULL) {
return NULL;
}
GdkAtom* selection = g_try_malloc(sizeof(GdkAtom));
if (selection == NULL) {
g_free(selection);
return NULL;
}
......
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