class Fir::RightArrowCommand

Public Class Methods

character_regex() click to toggle source
# File lib/fir/key_command/right_arrow_command.rb, line 8
def self.character_regex
  [/^\e\[C$/, /^\x06$/]
end

Public Instance Methods

execute_hook(new_state) click to toggle source
# File lib/fir/key_command/right_arrow_command.rb, line 12
def execute_hook(new_state)
  unless state.blank?
    if state.cursor.x < state.current_line.length
      new_state.cursor = state.cursor.right(1)
    end
  end
  new_state
end