Class: Fir::CtrlECommand

Inherits:
KeyCommand show all
Defined in:
lib/fir/key_command/ctrl_e_command.rb

Instance Attribute Summary

Attributes inherited from KeyCommand

#character, #state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from KeyCommand

build, #execute, for, handles?, inherited, #initialize, register, registry

Constructor Details

This class inherits a constructor from Fir::KeyCommand

Class Method Details

.character_regexObject



8
9
10
# File 'lib/fir/key_command/ctrl_e_command.rb', line 8

def self.character_regex
  /^\x05$/
end

Instance Method Details

#execute_hook(new_state) ⇒ Object



12
13
14
15
16
17
# File 'lib/fir/key_command/ctrl_e_command.rb', line 12

def execute_hook(new_state)
  unless state.blank?
    new_state.cursor = state.cursor.right(state.current_line.length - state.cursor.x)
  end
  new_state
end