Commits

Hannes Schueller  committed 873a4d7 Merge

Merge branch 'master' of ssh://git.code.sf.net/p/vimprobable/code into per-site-settings

  • Participants
  • Parent commits 690a7d1, f1f9939

Comments (0)

Files changed (2)

 */
 
 /* Vimprobable version number */
-#define VERSION "1.0.1"
+#define VERSION "1.0.2"
 #define INTERNAL_VERSION "Vimprobable2/"VERSION
 
 /* general settings */
     if (index < Info || index > Error)
         return TRUE;
 
-    set_widget_font_and_color(inputbox, urlboxfont[index], urlboxbgcolor[index], urlboxcolor[index]);
-    gtk_entry_set_text(GTK_ENTRY(inputbox), !arg->s ? "" : arg->s);
+    if (!gtk_widget_is_focus(GTK_WIDGET(inputbox))) {
+        set_widget_font_and_color(inputbox, urlboxfont[index], urlboxbgcolor[index], urlboxcolor[index]);
+        gtk_entry_set_text(GTK_ENTRY(inputbox), !arg->s ? "" : arg->s);
+    }
 
     return TRUE;
 }
 
 gboolean
 process_line(char *line) {
-    char *c = line;
+    char *c = line, *command_hist;
     int i;
     size_t len, length = strlen(line);
     gboolean found = FALSE, success = FALSE;
     /* Ignore blank lines.  */
     if (c[0] == '\0')
         return TRUE;
+
+    command_hist = g_strdup(c);
     for (i = 0; i < LENGTH(commands); i++) {
         if (commands[i].cmd == NULL)
             break;
             break;
         }
     }
-    save_command_history(c);
+
+    save_command_history(command_hist);
+    g_free(command_hist);
+
     if (!found) {
         a.i = Error;
         a.s = g_strdup_printf("Not a browser command: %s", c);