Class: Kward::PromptInterface::VibeEditorState
- Inherits:
-
Object
- Object
- Kward::PromptInterface::VibeEditorState
- Defined in:
- lib/kward/prompt_interface/editor/vibe_state.rb
Overview
Modal Vibe editor state for one editor buffer.
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#jump_back_list ⇒ Object
Returns the value of attribute jump_back_list.
-
#jump_forward_list ⇒ Object
Returns the value of attribute jump_forward_list.
-
#kill_linewise ⇒ Object
Returns the value of attribute kill_linewise.
-
#last_change ⇒ Object
Returns the value of attribute last_change.
-
#last_find ⇒ Object
Returns the value of attribute last_find.
-
#last_macro ⇒ Object
Returns the value of attribute last_macro.
-
#last_visual_selection ⇒ Object
Returns the value of attribute last_visual_selection.
-
#macros ⇒ Object
Returns the value of attribute macros.
-
#marks ⇒ Object
Returns the value of attribute marks.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#pending ⇒ Object
Returns the value of attribute pending.
-
#previous_change_cursor ⇒ Object
Returns the value of attribute previous_change_cursor.
-
#recording_macro ⇒ Object
Returns the value of attribute recording_macro.
-
#register_types ⇒ Object
Returns the value of attribute register_types.
-
#registers ⇒ Object
Returns the value of attribute registers.
-
#visual_block_insert ⇒ Object
Returns the value of attribute visual_block_insert.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(editor_mode: "modern") ⇒ VibeEditorState
constructor
A new instance of VibeEditorState.
Constructor Details
#initialize(editor_mode: "modern") ⇒ VibeEditorState
Returns a new instance of VibeEditorState.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 12 def initialize(editor_mode: "modern") @mode = editor_mode == "vibe" ? "normal" : nil @pending = "" @command = "" @last_change = nil @last_find = nil @last_visual_selection = nil @visual_block_insert = nil @marks = {} @registers = {} @register_types = {} @kill_linewise = false @previous_change_cursor = nil @jump_back_list = [] @jump_forward_list = [] @macros = {} @recording_macro = nil @last_macro = nil end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
7 8 9 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 7 def command @command end |
#jump_back_list ⇒ Object
Returns the value of attribute jump_back_list.
10 11 12 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 10 def jump_back_list @jump_back_list end |
#jump_forward_list ⇒ Object
Returns the value of attribute jump_forward_list.
10 11 12 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 10 def jump_forward_list @jump_forward_list end |
#kill_linewise ⇒ Object
Returns the value of attribute kill_linewise.
10 11 12 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 10 def kill_linewise @kill_linewise end |
#last_change ⇒ Object
Returns the value of attribute last_change.
7 8 9 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 7 def last_change @last_change end |
#last_find ⇒ Object
Returns the value of attribute last_find.
7 8 9 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 7 def last_find @last_find end |
#last_macro ⇒ Object
Returns the value of attribute last_macro.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def last_macro @last_macro end |
#last_visual_selection ⇒ Object
Returns the value of attribute last_visual_selection.
8 9 10 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 8 def last_visual_selection @last_visual_selection end |
#macros ⇒ Object
Returns the value of attribute macros.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def macros @macros end |
#marks ⇒ Object
Returns the value of attribute marks.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def marks @marks end |
#mode ⇒ Object
Returns the value of attribute mode.
7 8 9 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 7 def mode @mode end |
#pending ⇒ Object
Returns the value of attribute pending.
7 8 9 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 7 def pending @pending end |
#previous_change_cursor ⇒ Object
Returns the value of attribute previous_change_cursor.
10 11 12 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 10 def previous_change_cursor @previous_change_cursor end |
#recording_macro ⇒ Object
Returns the value of attribute recording_macro.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def recording_macro @recording_macro end |
#register_types ⇒ Object
Returns the value of attribute register_types.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def register_types @register_types end |
#registers ⇒ Object
Returns the value of attribute registers.
9 10 11 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 9 def registers @registers end |
#visual_block_insert ⇒ Object
Returns the value of attribute visual_block_insert.
8 9 10 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 8 def visual_block_insert @visual_block_insert end |
Class Method Details
.copy(other) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/kward/prompt_interface/editor/vibe_state.rb', line 32 def self.copy(other) state = new(editor_mode: other.mode ? "vibe" : "modern") state.mode = other.mode&.dup state.pending = other.pending.dup state.command = other.command.dup state.last_change = other.last_change&.dup state.last_find = other.last_find&.dup state.last_visual_selection = other.last_visual_selection&.dup state.visual_block_insert = other.visual_block_insert&.dup state.marks = other.marks.transform_values(&:dup) state.registers = other.registers.transform_values(&:dup) state.register_types = other.register_types.transform_values(&:dup) state.kill_linewise = other.kill_linewise state.previous_change_cursor = other.previous_change_cursor state.jump_back_list = other.jump_back_list.map(&:dup) state.jump_forward_list = other.jump_forward_list.map(&:dup) state.macros = other.macros.transform_values(&:dup) state.recording_macro = other.recording_macro state.last_macro = other.last_macro state end |