wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

Pull request for search_both_directions #73

Closed seifferth closed 3 years ago

seifferth commented 3 years ago

Use 'U' rather than 'N' for toggle unread

As discussed in https://github.com/wangp/bower/issues/70.

Use 'N' for next search result reverse direction

This commit removes the information about the initial search direction from thread pager and index view infos. It does also bind 'n' to next search result forward and 'N' to next search result reverse (which might be the previous search result in some cases). I personally find these bindings rather convenient, but am open to discuss them, of course.

I realise that this is a little different from how most programs handle the 'n' and 'N' keys. Most programs use 'n' for continue search in the direction it was started and 'N' for search in the other direction than the one specified while starting the search. The only other program I know of that uses the keybindings proposed here is https://github.com/martanne/vis (which also happens to be my text editor of choice, so I may be biassed). Simply using 'n' for search forward and 'N' for search reverse and ignoring the initial search direction makes the implementation more straightforward, however, since it requires less state. I also find it easier to use myself as I don't have to remember the initial search direction either. As mentioned, this may be personal preference, of course.

wangp commented 3 years ago

I can see the merit but honestly I found it rather confusing. I think I usually know which direction I want to search then just press n, n, n, and generally only press N after I overshoot.

wangp commented 3 years ago

Thanks. I've implemented the conventional n/N behaviour as it is my preference, and because I think it will be least surprising to most users.