Hi, This little patch series adds a couple of further improvements to the choose-mode code. Here's a description of the patches:
[1/6]: Splits out the WINLINK_* flag checking to its own function so that the choose-mode code can reuse the colour definitions when rendering lines. [2/6]: Makes use of winlink_set_alert_colours() when rendering window lines in choose-{tree,window}. [3/6]: Define backspace and 0-9 in the different mode-key trees for window choice. [4/6]: This introduces a "pos" field to struct window_choose_item_data, so that a given entry has an ID associated with it, rather than having to calculate it on the fly each time. [5/6]: This is the bulk of the work. I should probably have split this one out more, but couldn't be bothered. This defines WINDOW_CHOOSE_NORMAL when not in a mode. Removes window_choose_index_key() because now the prefix number is derived from the item->pos element instead (see patch 4/6). Changes the signature of window_choose_index_key() to only pass in the key to look for, since in this mode we guarantee the input to be a key between 0-9. Defines window_choose_prompt_input() when in a mode other than WINDOW_CHOOSE_NORMAL to prompt for information and fill the input buffer. This makes for future expansion easier. The point here with the bindings change is that the old behaviour is preserved when pressing a key (0-9) when the number of items listed is < 10, rather than prompting, because that's unambiguous. [6/6]: I got tired of copying/pasting the same four/fives lines, when setting the given gc to the values of mode-*, so created a function to do it, since this was used in window-copy as well. Questions, do please ask. Kindly, -- Thomas Adam Thomas Adam (6): Split out winlink colour settings Render winlink alerts in choose-mode Define 0-9 and backspace as bindings in choice-mode Add pos item to denote position in choose data Make choose entries use ever-increasing numeric ID Introduce window_mode_attrs() trunk/mode-key.c | 24 ++++++++ trunk/status.c | 33 +---------- trunk/tmux.h | 11 +++- trunk/window-choose.c | 146 +++++++++++++++++++++++++++++++++---------------- trunk/window-copy.c | 10 +--- trunk/window.c | 55 +++++++++++++++++++ 6 files changed, 192 insertions(+), 87 deletions(-) -- 1.7.10 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users