Module: CommandT::VIM::Window

Defined in:
lib/command-t/vim/window.rb

Class Method Summary collapse

Class Method Details

.select(window) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/command-t/vim/window.rb', line 8

def select(window)
  return true if $curwin == window
  initial = $curwin
  while true do
    ::VIM::command 'wincmd w'          # cycle through windows
    return true if $curwin == window   # have selected desired window
    return false if $curwin == initial # have already looped through all
  end
end