summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-23 20:44:03 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-23 20:44:03 +0200
commit38cc849239570fc7e3da575f4a0b6d86e11381e9 (patch)
treefa01082435259d225ef88a939469004d4765dc6a
parentae700b8f4d5a07cf424d7a010b42fce07bf2b191 (diff)
Show path and executable when completing
-rw-r--r--source/dialogs/run.c17
-rw-r--r--source/keyb.c2
2 files changed, 18 insertions, 1 deletions
diff --git a/source/dialogs/run.c b/source/dialogs/run.c
index 8fc7e80d..f8df9a5d 100644
--- a/source/dialogs/run.c
+++ b/source/dialogs/run.c
@@ -532,6 +532,22 @@ static cairo_surface_t *_get_icon ( const Mode *sw, unsigned int selected_line,
return NULL;
}
+static char *run_get_message ( const Mode *sw )
+{
+ RunModePrivateData *pd = sw->private_data;
+ if ( pd->file_complete ) {
+ if ( pd->selected_line < pd->cmd_list_length ) {
+ char *msg = mode_get_message ( pd->completer);
+ if (msg ){
+ char *retv = g_strdup_printf("File complete for: %s\n%s", pd->cmd_list[pd->selected_line].entry, msg);
+ g_free (msg);
+ return retv;
+ }
+ return g_strdup_printf("File complete for: %s", pd->cmd_list[pd->selected_line].entry);
+ }
+ }
+ return NULL;
+}
#include "mode-private.h"
Mode run_mode =
@@ -543,6 +559,7 @@ Mode run_mode =
._result = run_mode_result,
._destroy = run_mode_destroy,
._token_match = run_token_match,
+ ._get_message = run_get_message,
._get_display_value = _get_display_value,
._get_icon = _get_icon,
._get_completion = NULL,
diff --git a/source/keyb.c b/source/keyb.c
index 4d7e6dea..3bd51841 100644
--- a/source/keyb.c
+++ b/source/keyb.c
@@ -66,7 +66,7 @@ ActionBindingEntry rofi_bindings[] =
{ .id = DELETE_ENTRY, .name = "kb-delete-entry", .binding = "Shift+Delete", .comment = "Delete entry from history" },
{ .id = MODE_NEXT, .name = "kb-mode-next", .binding = "Shift+Right,Control+Tab", .comment = "Switch to the next mode." },
{ .id = MODE_PREVIOUS, .name = "kb-mode-previous", .binding = "Shift+Left,Control+ISO_Left_Tab", .comment = "Switch to the previous mode." },
- { .id = MODE_COMPLETE, .name = "kb-mode-complete", .binding = "Control+l", .comment = "Start mode complete." },
+ { .id = MODE_COMPLETE, .name = "kb-mode-complete", .binding = "Control+l", .comment = "Start completion for mode." },
{ .id = ROW_LEFT, .name = "kb-row-left", .binding = "Control+Page_Up", .comment = "Go to the previous column" },
{ .id = ROW_RIGHT, .name = "kb-row-right", .binding = "Control+Page_Down", .comment = "Go to the next column" },
{ .id = ROW_UP, .name = "kb-row-up", .binding = "Up,Control+p,ISO_Left_Tab", .comment = "Select previous entry" },