Skip to content
Kward Search API index

Class: Kward::NativeShell::ViTerminal

Inherits:
LineTerminal show all
Defined in:
lib/kward/shell/native_vi_terminal.rb

Constant Summary

Constants inherited from LineTerminal

LineTerminal::GET_ATTRIBUTES, LineTerminal::MAX_ESCAPE_BYTES, LineTerminal::MAX_PASTE_BYTES, LineTerminal::META_KEYS

Instance Method Summary collapse

Constructor Details

#initialize(runtime) ⇒ ViTerminal

Returns a new instance of ViTerminal.



7
8
9
# File 'lib/kward/shell/native_vi_terminal.rb', line 7

def initialize(runtime)
  super(runtime, ViEditor.new(runtime))
end

Instance Method Details

#read(source, **options) ⇒ Object



11
12
13
14
15
16
# File 'lib/kward/shell/native_vi_terminal.rb', line 11

def read(source, **options)
  super
rescue ExecutionError, SystemCallError, IOError => e
  @runtime.vi_input_error(e, error: options.fetch(:error))
  ViEditor::Result.new(text: "")
end