class Fir::CtrlVCommand

Public Class Methods

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

Public Instance Methods

execute_hook(new_state) click to toggle source
# File lib/fir/key_command/ctrl_v_command.rb, line 12
def execute_hook(new_state)
  paste_buffer = `pbpaste`
  new_state.current_line = state.current_line.clone.insert(
    state.cursor.x,
    *paste_buffer.split('')
  ).flatten
  new_state.cursor = state.cursor.right(paste_buffer.length)
  new_state.history.reset
  new_state
end