On Sun, Jul 15, 2012 at 12:31:08PM +0100, Thomas Adam wrote:
> So that entries as listed in choose-* mode commands can be selected with a
> numeric prefix, ensure we know which prefix that is, by maintaining the
> index of that item in the array.
> ---
>  trunk/tmux.h          |    5 +++--
>  trunk/window-choose.c |    1 +
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/trunk/tmux.h b/trunk/tmux.h
> index 39d1489..3fbec0c 100644
> --- a/trunk/tmux.h
> +++ b/trunk/tmux.h
> @@ -856,8 +856,9 @@ struct window_choose_data {
>  };
>  
>  struct window_choose_mode_item {
> -    struct window_choose_data   *wcd;
> -    char                        *name;
> +     struct window_choose_data       *wcd;
> +     char                            *name;
> +     int                              pos;
>  };
>  
>  /* Child window structure. */
> diff --git a/trunk/window-choose.c b/trunk/window-choose.c
> index 96d13f5..79cd06f 100644
> --- a/trunk/window-choose.c
> +++ b/trunk/window-choose.c
> @@ -76,6 +76,7 @@ window_choose_add(struct window_pane *wp, struct 
> window_choose_data *wcd)
>  
>       item->name = format_expand(wcd->ft, wcd->ft_template);
>       item->wcd = wcd;
> +     item->pos = ARRAY_LENGTH(&data->list) - 1;

I'm thinking that this is silly, and instead, we should be using the #{line}
replacement field from the format specifier instead.

-- Thomas Adam

-- 
"Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)

------------------------------------------------------------------------------
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

Reply via email to