Permalink
Browse files

document the logic in Window#current_pane

  • Loading branch information...
dominikh committed Apr 16, 2011
1 parent dc03587 commit 1061642bb34e55ef99d14c51b3bb9346d3fd39ef
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/tmux/window.rb
View
@@ -636,6 +636,12 @@ def current_pane(return_if = :always)
if server.version >= "1.4"
self.panes.find(&:active?)
else
+ # In tmux <1.4, we can only determine the selected pane of the
+ # current window.
+ #
+ # If the user specified return_if = :always, we select this
+ # window (if it is not already selected), determine the
+ # current pane and select the lastly selected window again.
cur_window = self.session.any_client.current_window
same_window = cur_window == self
return_if_b = ((return_if == :if_same_window && same_window) || (return_if == :always))

0 comments on commit 1061642

Please sign in to comment.