[Vimprobable-users] [PATCH 2/3] Show setting on set command without value
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
|
From: Raphael N. <rne...@hs...> - 2012-07-18 19:23:45
|
Give the ability to see settings. A command like :set useragent will
show something like useragent = Vimprobable2/1.03
---
main.c | 10 ++++++++--
1 Datei geändert, 8 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
diff --git a/main.c b/main.c
index 0fbe472..56d3dc1 100644
--- a/main.c
+++ b/main.c
@@ -1894,8 +1894,14 @@ process_set_line(char *line) {
for (i = 0; i < listlen; i++) {
if (strlen(browsersettings[i].name) == strlen(my_pair.what) && strncmp(browsersettings[i].name, my_pair.what, strlen(my_pair.what)) == 0) {
/* mandatory argument not provided */
- if (strlen(my_pair.value) == 0)
- return FALSE;
+ if (strlen(my_pair.value) == 0) {
+ /* workaround: give_feedback() doesn't show anything if inputbar has user focus */
+ gtk_widget_grab_focus(GTK_WIDGET(webview));
+ char* info = g_strdup_printf("%s = %s", browsersettings[i].name, browsersettings[i].var);
+ give_feedback(info);
+ g_free(info);
+ return TRUE;
+ }
/* process qmark? */
if (strlen(my_pair.what) == 5 && strncmp("qmark", my_pair.what, 5) == 0) {
return (process_save_qmark(my_pair.value, webview));
--
1.7.11.2
|