> I see the commit c930fd5ff696f5a60e93ed503f0ff57e0bbf6e4d "Remember
> the last active pane in the top-bottom or left-right cell..." changed
> the behavior of pane navigation. If it possible, I really want an
> option to restore the old behavior.

I agree, this is a behavior change in the new version and it also makes
hard to navigate the grid-based layouts. It would have been nice if this
had been restricted to an option. I've appended a patch implementing
this.

---
diff --git a/CHANGES b/CHANGES
index 9240272..ec62571 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+CHANGES FROM 1.9a to 1.10
+
+Normal Changes
+==============
+
+* Add new window option called remember-last-pane.
+
 CHANGES FROM 1.9 to 1.9a 22 February 2014
 
 NOTE:  This is a bug-fix release to address some important bugs which just
diff --git a/examples/tmux.vim b/examples/tmux.vim
index 4d64514..c096a59 100644
--- a/examples/tmux.vim
+++ b/examples/tmux.vim
@@ -249,6 +249,7 @@ syn keyword tmuxOptsSetw
        \ other-pane-width
        \ pane-base-index
        \ remain-on-exit
+       \ remember-last-pane
        \ synchronize-panes
        \ utf8
        \ window-status-activity-style
diff --git a/options-table.c b/options-table.c
index 64d3edc..d60e535 100644
--- a/options-table.c
+++ b/options-table.c
@@ -666,6 +666,11 @@ const struct options_table_entry window_options_table[] = {
          .default_num = 0
        },
 
+       { .name = "remember-last-pane",
+         .type = OPTIONS_TABLE_FLAG,
+         .default_num = 1
+       },
+
        { .name = "synchronize-panes",
          .type = OPTIONS_TABLE_FLAG,
          .default_num = 0
diff --git a/tmux.1 b/tmux.1
index 51d927a..d4a095b 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2914,6 +2914,12 @@ The window may be reactivated with the
 .Ic respawn-window
 command.
 .Pp
+.It Xo Ic remember-last-pane
+.Op Ic on | off
+.Xc
+Remember the last active pane in the top-bottom or left-right cell so that it
+can be restored when moving back to that cell. Default is on.
+.Pp
 .It Xo Ic synchronize-panes
 .Op Ic on | off
 .Xc
diff --git a/window.c b/window.c
index 1dd70c4..330d48a 100644
--- a/window.c
+++ b/window.c
@@ -397,6 +397,9 @@ window_pane_active_set(struct window_pane *wp, struct 
window_pane *nextwp)
        struct layout_cell      *lc;
        struct window_pane      *lastwp;
 
+       if (options_get_number(&wp->window->options, "remember-last-pane") == 0)
+               return (nextwp);
+
        /* Target pane's parent must not be an ancestor of source pane. */
        for (lc = wp->layout_cell->parent; lc != NULL; lc = lc->parent) {
                if (lc == nextwp->layout_cell->parent)
-- 
Balazs

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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