Skip to content

Instantly share code, notes, and snippets.

@kiko
Created September 10, 2009 12:30
Show Gist options
  • Save kiko/184522 to your computer and use it in GitHub Desktop.
Save kiko/184522 to your computer and use it in GitHub Desktop.
GRABS.merge!({
'W-k' => lambda{ focus_next },
'W-j' => lambda{ focus_previous },
})
module Subtlext
class Subtle
def move_focus(step)
i = current_view.clients.index{|c| c.id == current_client.id} + step
(current_view.clients[i] || current_view.clients.first).focus
end
def focus_next
move_focus(1)
end
def focus_previous
move_focus(-1)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment