diff --git a/helix-loader/src/session.rs b/helix-loader/src/session.rs index 691333d99..7619ff36a 100644 --- a/helix-loader/src/session.rs +++ b/helix-loader/src/session.rs @@ -88,9 +88,13 @@ fn read_reg_history(filepath: PathBuf) -> Vec { } pub fn read_command_history() -> Vec { - read_reg_history(command_histfile()) + let mut hist = read_reg_history(command_histfile()); + hist.reverse(); + hist } pub fn read_search_history() -> Vec { - read_reg_history(search_histfile()) + let mut hist = read_reg_history(search_histfile()); + hist.reverse(); + hist } diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index e7de35bb6..810cd2521 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -169,13 +169,13 @@ impl Application { #[cfg(not(feature = "integration"))] editor .registers - .write_unreversed(':', session::read_command_history()) + .write(':', session::read_command_history()) // TODO: do something about this unwrap .unwrap(); #[cfg(not(feature = "integration"))] editor .registers - .write_unreversed('/', session::read_search_history()) + .write('/', session::read_search_history()) // TODO: do something about this unwrap .unwrap(); diff --git a/helix-view/src/register.rs b/helix-view/src/register.rs index 0c2b5d4d6..3a2e1b7cc 100644 --- a/helix-view/src/register.rs +++ b/helix-view/src/register.rs @@ -104,29 +104,6 @@ impl Registers { } } - pub fn write_unreversed(&mut self, name: char, values: Vec) -> Result<()> { - match name { - '_' => Ok(()), - '#' | '.' | '%' => Err(anyhow::anyhow!("Register {name} does not support writing")), - '*' | '+' => { - self.clipboard_provider.set_contents( - values.join(NATIVE_LINE_ENDING.as_str()), - match name { - '+' => ClipboardType::Clipboard, - '*' => ClipboardType::Selection, - _ => unreachable!(), - }, - )?; - self.inner.insert(name, values); - Ok(()) - } - _ => { - self.inner.insert(name, values); - Ok(()) - } - } - } - pub fn push(&mut self, name: char, mut value: String) -> Result<()> { match name { '_' => Ok(()),