diff options
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r-- | helix-view/src/commands.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs index 6efbf98d..888317e7 100644 --- a/helix-view/src/commands.rs +++ b/helix-view/src/commands.rs @@ -307,8 +307,20 @@ pub fn append_mode(view: &mut View, _count: usize) { }) } -pub fn command_mode(view: &mut View, _count: usize) { - view.state.mode = Mode::Command; +pub fn prompt_mode(view: &mut View, _count: usize) { + view.state.mode = Mode::Prompt; +} + +pub fn move_char_left_prompt(prompt: &mut Prompt, _char: char) { + if prompt.cursor_loc > 1 { + prompt.cursor_loc -= 1; + } +} + +pub fn move_char_right_prompt(prompt: &mut Prompt, _char: char) { + if prompt.cursor_loc < prompt.buffer.len() { + prompt.cursor_loc += 1; + } } // TODO: I, A, o and O can share a lot of the primitives. |