diff options
author | Alain Bench <veronatif@free.fr> | 2006-07-04 17:23:16 +0000 |
---|---|---|
committer | Alain Bench <veronatif@free.fr> | 2006-07-04 17:23:16 +0000 |
commit | 86c449be7fdff9f4d67e5288f5ca355da37ab0c9 (patch) | |
tree | 83d599b3a6051ac38968db821f4818829c49139a /history.c | |
parent | bddc24cd086bb3d0126ee4edc9d6de04d96fccfc (diff) |
Adopt shell convention of omitting from the history commands prefixed
with a space.
Diffstat (limited to 'history.c')
-rw-r--r-- | history.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) |