Module: Rib::MultilineHistory

Extended by:
Plugin
Defined in:
lib/rib/more/multiline_history.rb

Instance Attribute Summary

Attributes included from Plugin

#disabled

Instance Method Summary collapse

Methods included from Plugin

disable, disabled?, enable, enabled?, extended

Instance Method Details

#before_loopObject

————— Rib API —————



11
12
13
14
# File 'lib/rib/more/multiline_history.rb', line 11

def before_loop
  @multiline_trash = 0
  super
end

#handle_interruptObject



24
25
26
27
28
29
30
31
# File 'lib/rib/more/multiline_history.rb', line 24

def handle_interrupt
  return super if MultilineHistory.disabled?
  if multiline_buffer.size > 1
    multiline_trash
    @multiline_trash += 1
  end
  super
end

#loop_eval(input) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rib/more/multiline_history.rb', line 16

def loop_eval input
  return super if MultilineHistory.disabled?
  super
ensure
  # SyntaxError might mean we're multiline editing
  handle_multiline unless multiline?($!)
end