[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] search history

From: Chris Allegretta
Subject: Re: [Nano-devel] search history
Date: Thu, 24 Oct 2002 16:25:47 -0700
User-agent: Mutt/

On Fri, Oct 25, 2002 at 09:07:50AM +1000, Ken Tyler wrote:
> Hello,
> cycle back ?
> Not ever seen this happen in any incarnation of the patch and not
> intended. Up arrow gets you to the oldest and no further, down arrow gets
> you to the blank line and no more. Can you look again ?

No, what I'm saying is I added a bit to the code so that it cycles back:

char *get_history_older(historyheadtype *h)
    if (h->current->next->next)         /* any older entries ? */
        h->current = h->current->next;  /* yes */
    else {
        while (h->current->prev)
            h->current = h->current->prev;
        h->current = h->current->next;
    return h->current->data;

char *get_history_newer(historyheadtype *h)
    if (h->current->prev->prev)
        h->current = h->current->prev;
        h->current = search_history.tail;

    return h->current->data;
/* end of history support functions */

That's all :)

> > I like how unobtrusive it is.
> No up/down arrow action and you wouldn't know it was there.

I meant code-wise actually ;-)  But true, it is that way also.

> > The question becomes whether to implement what I proposed in my 
> > earlier mail (and well in the past).
> I'm a bit unsure about your suggested uniform pico/nano Search
> status line.
> What a user ends up seeing is :
> ^W          Search [redwood] :                (last search)
> up one      Search [tree] :                   (next older search)
> 12          Search [] : tree_bad_thing        (edit it)
> up one      Search [saw] :                    (one older again)
> There's a bit of jumping about going on which I'm not keen on. I still
> favour no search history in pico and as is in nano (as is being what I
> describe, not what you are seeing).  Have a think about it and I'll do
> whatever.

This is what I was trying to describe, one uniform mode for search:

^W      Search [redwood]:                       (last search)

Now, the user can hit enter to accept the previous string, or type 
a new string, as if it were Pico mdoe.  Or:

up one  Search: redwood                         (Now editable)

Now the text is editable, as if it were nano mode.  Then they can hit

up one  Search: tree                            (next older search)

to cycle to the previous searches.  See?  This way we could really have
one mode, we get the benefits of Pico mode (don't have to erase the
previous string to type a new one) plus the benefits of nano mode (we
can edit the string if we hit up or down).  I phrased my email poorly. 
Let me know if this makes sense :)

Chris A
Chris Allegretta

"Share and Enjoy" - Douglas Adams, 1952 - 2001

reply via email to

[Prev in Thread] Current Thread [Next in Thread]