From 62d651eb8df535c0176b254f6dee25d176d0aeff Mon Sep 17 00:00:00 2001 From: pagedmov Date: Mon, 23 Feb 2026 21:25:27 -0500 Subject: [PATCH] Fixed hint-related regression caused by recent history logic changes --- src/expand.rs | 6 ++++-- src/prompt/readline/history.rs | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/expand.rs b/src/expand.rs index 29e9642..22279c1 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -11,7 +11,7 @@ use crate::parse::lex::{LexFlags, LexStream, Tk, TkFlags, TkRule, is_field_sep, use crate::parse::{Redir, RedirType}; use crate::procio::{IoBuf, IoFrame, IoMode, IoStack}; use crate::state::{ - LogTab, VarFlags, read_jobs, read_logic, read_vars, write_jobs, write_meta, write_vars, + LogTab, VarFlags, read_logic, read_vars, write_jobs, write_meta, write_vars, }; use crate::{jobs, prelude::*}; @@ -36,7 +36,9 @@ pub const PROC_SUB_OUT: char = '\u{fdd6}'; /// arguments Without this marker, it would be handled like an empty string, /// which breaks some commands pub const NULL_EXPAND: char = '\u{fdd7}'; - +/// Explicit marker for argument separation +/// This is used to join the arguments given by "$@", and preserves exact formatting +/// of the original arguments, including quoting pub const ARG_SEP: char = '\u{fdd8}'; impl Tk { diff --git a/src/prompt/readline/history.rs b/src/prompt/readline/history.rs index c7bdd9a..5ceda53 100644 --- a/src/prompt/readline/history.rs +++ b/src/prompt/readline/history.rs @@ -285,6 +285,8 @@ impl History { if let Some(pending) = &mut self.pending { pending.set_buffer(cmd); pending.cursor.set(cursor_pos); + } else { + self.pending = Some(LineBuf::new().with_initial(&cmd, cursor_pos)); } self.constrain_entries(constraint); } @@ -357,10 +359,6 @@ impl History { .saturating_add_signed(offset) .clamp(0, self.search_mask.len()); - log::debug!( - "Scrolling history by offset {offset} from cursor at index {}", - self.cursor - ); self.search_mask.get(self.cursor) }