Don't handle command and :open history different.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 22 Jul 2013 15:23:17 +0000 (17:23 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 22 Jul 2013 15:23:17 +0000 (17:23 +0200)
The stepping through history via <up> and <down> keys generated different
items for ':open<up>' and ':open <up>'. The reason for this was that we looked
up the history file to get the item, ':open<up>' entries where collected from
command history file where also none url entries are available (like call with
shortcuts).

Now the history lookup does not distinguish between commands and urls and
follows the inspiring example of vim, where ':e <up>' also lists none
processed values like ':e %'.

src/history.c

index 8072962..4e08ef6 100644 (file)
@@ -204,13 +204,10 @@ static GList *get_list(const char *input)
     input_type = vb_get_input_parts(input, &prefix, &suffix);
 
     /* get the right history type and command prefix */
-    if (input_type == VB_INPUT_OPEN
+    if (input_type == VB_INPUT_COMMAND
+        || input_type == VB_INPUT_OPEN
         || input_type == VB_INPUT_TABOPEN
     ) {
-        type = HISTORY_URL;
-        OVERWRITE_STRING(history.query, suffix);
-        OVERWRITE_STRING(history.prefix, prefix);
-    } else if (input_type == VB_INPUT_COMMAND) {
         type = HISTORY_COMMAND;
         OVERWRITE_STRING(history.query, suffix);
         OVERWRITE_STRING(history.prefix, prefix);