aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/commands.rs
diff options
context:
space:
mode:
authorJan Hrastnik2020-10-12 22:23:48 +0000
committerBlaž Hrastnik2020-10-16 03:00:28 +0000
commited03ec92a825b8e42005f2f8506b0f3db4923fa5 (patch)
treec7e3da955be3e296c4f2f549fc91c1d4d47a1f3b /helix-view/src/commands.rs
parent7208c86f23ac6d75aff62268cff73089c068cf74 (diff)
moved prompt command matching to prompt.rs
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r--helix-view/src/commands.rs16
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.