Skip to content

Commit

Permalink
Adopt shell convention of omitting from the history commands prefixed
Browse files Browse the repository at this point in the history
with a space.
  • Loading branch information
Alain Bench committed Jul 4, 2006
1 parent cf2f59c commit 99293b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion history.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 99293b4

Please sign in to comment.