class Fir::SingleKeyCommand

Public Class Methods

character_regex() click to toggle source
# File lib/fir/key_command/single_key_command.rb, line 8
def self.character_regex
  # Matches all printable ASCII characters
  /[ -~]/
end

Public Instance Methods

execute_hook(new_state) click to toggle source
# File lib/fir/key_command/single_key_command.rb, line 13
def execute_hook(new_state)
  new_state.current_line = state.lines[-1].clone.insert(
    state.cursor.x,
    character
  )
  new_state.cursor = state.cursor.right(1)
  new_state.history.reset
  new_state
end