Don't block search and url history if not typed (#133).
authorDaniel Carl <danielcarl@gmx.de>
Sun, 7 Dec 2014 23:09:59 +0000 (00:09 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 7 Dec 2014 23:09:59 +0000 (00:09 +0100)
If a command was not typed, it was not stored in history. But this is
irritating if there is a map that opens a URI. In this case the URI was not
written ti URL history, which feels wrong. So now only the ex command history
recording is blocked if the content was not typed by the user or where given
via vimb fifo.

src/history.c

index 9035baf..63c210e 100644 (file)
@@ -77,9 +77,9 @@ void history_add(HistoryType type, const char *value, const char *additional)
 {
     const char *file;
 
-    /* Don't write a history entry to the file if the commands where not typed
-     * by the user or the history max size is set to 0. */
-    if (!vb.config.history_max || !vb.state.typed) {
+    /* Don't write a history entry if the history max size is set to 0. Else
+     * skip command history in case the command was not typed by the user. */
+    if (!vb.config.history_max || (!vb.state.typed && type == HISTORY_COMMAND)) {
         return;
     }