]> granicus.if.org Git - mutt/commitdiff
Adopt shell convention of omitting from the history commands prefixed
authorAlain Bench <veronatif@free.fr>
Tue, 4 Jul 2006 17:23:16 +0000 (17:23 +0000)
committerAlain Bench <veronatif@free.fr>
Tue, 4 Jul 2006 17:23:16 +0000 (17:23 +0000)
with a space.

history.c

index a105b5aed30734372bf32761fdc93a5281c4eb37..4bee9ab950584917aeb3f999a8aad433ab1cfee8 100644 (file)
--- a/history.c
+++ b/history.c
@@ -81,7 +81,12 @@ void mutt_history_add (history_class_t hclass, const char *s)
   {
     prev = h->last - 1;
     if (prev < 0) prev = HistSize - 1;
-    if (!h->hist[prev] || mutt_strcmp (h->hist[prev], s) != 0)
+
+    /* don't add to prompt history:
+     *  - lines beginning by a space
+     *  - repeated lines
+     */
+    if (*s != ' ' && (!h->hist[prev] || mutt_strcmp (h->hist[prev], s) != 0))
     {
       mutt_str_replace (&h->hist[h->last++], s);
       if (h->last > HistSize - 1)