class Fir::LeftArrowCommand
Public Class Methods
character_regex()
click to toggle source
# File lib/fir/key_command/left_arrow_command.rb, line 8 def self.character_regex [/^\e\[D$/, /^\x02$/] end
Public Instance Methods
execute_hook(new_state)
click to toggle source
# File lib/fir/key_command/left_arrow_command.rb, line 12 def execute_hook(new_state) unless state.blank? new_state.cursor = state.cursor.left(1) if state.cursor.x.positive? end new_state end