aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/prompt.rs
diff options
context:
space:
mode:
authorSaber Haj Rabiee2022-06-24 15:14:48 +0000
committerGitHub2022-06-24 15:14:48 +0000
commit3dbad0442fc3038dd0b0f6bd07ba0e40d2d92000 (patch)
treeb785a62627ea7035e1cc330570c33ad4ee09724a /helix-term/src/ui/prompt.rs
parentd948ace67b10f162fd00106b9be2c1c680f33861 (diff)
fixes showing the last prompt on empty input (#2870)
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r--helix-term/src/ui/prompt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index beba8ce9..55b08032 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -443,7 +443,7 @@ impl Prompt {
let input: Cow<str> = if self.line.is_empty() {
// latest value in the register list
self.history_register
- .and_then(|reg| cx.editor.registers.first(reg))
+ .and_then(|reg| cx.editor.registers.last(reg))
.map(|entry| entry.into())
.unwrap_or_else(|| Cow::from(""))
} else {
@@ -522,7 +522,7 @@ impl Component for Prompt {
let input: Cow<str> = if self.line.is_empty() {
// latest value in the register list
self.history_register
- .and_then(|reg| cx.editor.registers.first(reg).cloned())
+ .and_then(|reg| cx.editor.registers.last(reg).cloned())
.map(|entry| entry.into())
.unwrap_or_else(|| Cow::from(""))
} else {