Similar to paste history, introduce find history in toolbelt
By james.wid... on October 21, 2014 03:03 (imported from Google Code)
There doesn't seem to be much hidden complexity here (at least at first glance).
Background: In the toolbelt, in the paste history, the list grows by one whenever (1) text is copied to clipboard in iTerm or (2) clipboard content from outside iTerm is pasted in iTerm.
Similarly, I could use a sub-window within the toolbelt that keeps a list of strings that have previously been entered into the "Find..." text field.
One difference is that the "regex" and "case ignore" bits would have to be remembered along with the string.
Another difference is that, unlike the clipboard, you can have one find-string per window.
The point is not to have a separate list for each pane; I think we probably just want a single list that is shared by all panes in all tabs in all windows. The reason is that you'll often want to re-apply the same search in different windows/tabs/panes, but you'll find out only after you've done the search (perhaps after you lost the chance to copy that carefully-crafted regex to the clipboard).
But there is a UI issue that can come up when people have focus-follows-mouse enabled. So, you could get into this scenario: you have a window that is boxed in, so that you cannot move the mouse to the toolbelt without de-selecting it.
One way to deal with this is by making the find history available in the secondary-click menu.
Another way is to extend the existing drop-down menu that you get when focus is in a pane's search field and you either (1) hit the magnifying-glass icon or (2) use <command-down arrow>. Currently, this list has only two items, and each is a toggle item for the two search flags (case-ignore and regex/non-regex). This list could be dynamically extended so that, at the top, we have those options; then a divider line, then an entry for each element in the search history.
Yet another way would be to enable click-and-drag: grab an element from the find-history in the toolbelt, and drop it onto the pane where you want it applied.
And yet another way would be to make it kind of like a special paste: e.g. <command-control-f> could apply the currently-selected find-history element to the pane with focus. (so, user does: (A) select find-history element; (B) put focus on some pane, in any tab, any window, (C) hit some key-binding, and then the effect would be as if (1) the text from the history entry had been auto-filled into the search field for that pane, and (2) the case-igore & regex bits from that item had been set to those of the same history item.) This would enable the user to quickly apply the same complex regex to multiple panes.
Before I thought about the focus-follows-mouse issue above, I thought this might be one of those things I could finish "on my lunch break" (by stealing from the code used to implement paste history). But now that I can see so many UI choices, I'm not so sure.
Thanks for reading this far! (: