Hi

I tried this and honestly I don't like it, I think it is unexpected that
if I do splitw and the pane unzooms it then zooms again when I select
it. It's better for the pane not to secretly stay zoomed - it isn't so
hard to zoom it again if that's what you want.


On Sat, Nov 16, 2013 at 04:38:59PM +0100, Maykel Moya wrote:
> Signed-off-by: Maykel Moya <mm...@mmoya.org>
> ---
>  cmd-resize-pane.c |  7 +++++--
>  cmd-select-pane.c | 10 ++++++++--
>  tmux.h            |  1 +
>  3 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c
> index d31f886..d8ee076 100644
> --- a/cmd-resize-pane.c
> +++ b/cmd-resize-pane.c
> @@ -101,10 +101,13 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_q 
> *cmdq)
>       w = wl->window;
>  
>       if (args_has(args, 'Z')) {
> -             if (w->flags & WINDOW_ZOOMED)
> +             if (w->flags & WINDOW_ZOOMED) {
>                       window_unzoom(w);
> -             else
> +                     wp->flags &= ~PANE_ZOOMED;
> +             } else {
>                       window_zoom(wp);
> +                     wp->flags |= PANE_ZOOMED;
> +             }
>               server_redraw_window(w);
>               server_status_window(w);
>               return (CMD_RETURN_NORMAL);
> diff --git a/cmd-select-pane.c b/cmd-select-pane.c
> index c342fef..89cfb82 100644
> --- a/cmd-select-pane.c
> +++ b/cmd-select-pane.c
> @@ -109,8 +109,14 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q 
> *cmdq)
>       }
>  
>       window_set_active_pane(wl->window, wp);
> -     server_status_window(wl->window);
> -     server_redraw_window_borders(wl->window);
> +     if (wp->flags & PANE_ZOOMED) {
> +             window_zoom(wp);
> +             server_redraw_window(wl->window);
> +             server_status_window(wl->window);
> +     } else {
> +             server_status_window(wl->window);
> +             server_redraw_window_borders(wl->window);
> +     }
>  
>       return (CMD_RETURN_NORMAL);
>  }
> diff --git a/tmux.h b/tmux.h
> index dbc2c49..425e000 100644
> --- a/tmux.h
> +++ b/tmux.h
> @@ -904,6 +904,7 @@ struct window_pane {
>  #define PANE_FOCUSED 0x4
>  #define PANE_RESIZE 0x8
>  #define PANE_FOCUSPUSH 0x10
> +#define PANE_ZOOMED 0x20
>  
>       char            *cmd;
>       char            *shell;
> -- 
> 1.8.3.2
> 
> 
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to