slackbuilds_ponce/libraries/libfm/patches/0002-3582816-If-no-region-is-selected-in-editable-then-ap.patch
Matteo Bernardini 23b8c687d9 libraries/libfm: Apply patches from upstream.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
2012-12-23 09:16:47 -05:00

33 lines
1.1 KiB
Diff

From 74901d717fefaf239bf7d8b6f5b14ea146170663 Mon Sep 17 00:00:00 2001
From: Andriy Grytsenko <andrej@rep.kiev.ua>
Date: Sat, 3 Nov 2012 16:05:31 +0200
Subject: [PATCH 02/22] [#3582816]If no region is selected in editable then
apply 'Delete' to char next to cursor.
---
src/gtk/fm-folder-view.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gtk/fm-folder-view.c b/src/gtk/fm-folder-view.c
index 153ed48..fe65e9f 100644
--- a/src/gtk/fm-folder-view.c
+++ b/src/gtk/fm-folder-view.c
@@ -1001,7 +1001,15 @@ static void on_trash(GtkAction* act, FmFolderView* fv)
}
}
else if(GTK_IS_EDITABLE(focus)) /* fallback for editables */
+ {
+ if(!gtk_editable_get_selection_bounds((GtkEditable*)focus, NULL, NULL))
+ {
+ gint pos = gtk_editable_get_position((GtkEditable*)focus);
+ /* if no text selected then delete character next to cursor */
+ gtk_editable_select_region((GtkEditable*)focus, pos, pos + 1);
+ }
gtk_editable_delete_selection((GtkEditable*)focus);
+ }
}
static void on_rm(GtkAction* act, FmFolderView* fv)
--
1.8.0.1