class Fir::EnterCommand

Public Class Methods

character_regex() click to toggle source
# File lib/fir/key_command/enter_command.rb, line 8
def self.character_regex
  /^\r$/
end

Public Instance Methods

execute_hook(new_state) click to toggle source
# File lib/fir/key_command/enter_command.rb, line 12
def execute_hook(new_state)
  new_state.commit_current_line_to_history
  new_state.lines = state.lines.add([])
  new_state.cursor = state.cursor.down.left(state.cursor.x)
  new_state.history.reset
  new_state
end