diff options
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 4 | ||||
-rw-r--r-- | helix-term/src/ui/prompt.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 329b7ab7..6f10848a 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1911,7 +1911,7 @@ fn search_next_or_prev_impl(cx: &mut Context, movement: Movement, direction: Dir let register = cx.register.unwrap_or('/'); let config = cx.editor.config(); let scrolloff = config.scrolloff; - if let Some(query) = cx.editor.registers.last(register, cx.editor) { + if let Some(query) = cx.editor.registers.first(register, cx.editor) { let doc = doc!(cx.editor); let contents = doc.text().slice(..).to_string(); let search_config = &config.search; @@ -1983,7 +1983,7 @@ fn search_selection(cx: &mut Context) { fn make_search_word_bounded(cx: &mut Context) { let register = cx.register.unwrap_or('/'); - let regex = match cx.editor.registers.last(register, cx.editor) { + let regex = match cx.editor.registers.first(register, cx.editor) { Some(regex) => regex, None => return, }; diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 8dc2906a..702a6e67 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -307,7 +307,7 @@ impl Prompt { ) { (self.callback_fn)(cx, &self.line, PromptEvent::Abort); let mut values = match cx.editor.registers.read(register, cx.editor) { - Some(values) if values.len() > 0 => values, + Some(values) if values.len() > 0 => values.rev(), _ => return, }; @@ -473,7 +473,7 @@ impl Prompt { // Show the most recently entered value as a suggestion. if let Some(suggestion) = self .history_register - .and_then(|reg| cx.editor.registers.last(reg, cx.editor)) + .and_then(|reg| cx.editor.registers.first(reg, cx.editor)) { surface.set_string(line_area.x, line_area.y, suggestion, suggestion_color); } @@ -570,7 +570,7 @@ impl Component for Prompt { } else { let last_item = self .history_register - .and_then(|reg| cx.editor.registers.last(reg, cx.editor)) + .and_then(|reg| cx.editor.registers.first(reg, cx.editor)) .map(|entry| entry.to_string()) .unwrap_or_else(|| String::from("")); |