Skip to content

Commit 347a333

Browse files
committed
[sweep] window uids added window stack
1 parent 559e68e commit 347a333

File tree

8 files changed

+305
-132
lines changed

8 files changed

+305
-132
lines changed

Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chronicler-cli/src/navigator.rs

+1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ impl Navigator {
277277
mode.enter(self).await?;
278278
}
279279
}
280+
SweepEvent::Window { .. } => {}
280281
}
281282
}
282283
Ok(Vec::new())

sweep-cli/src/main.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ async fn main() -> Result<(), Error> {
111111
prompt_icon: Some(args.prompt_icon),
112112
theme,
113113
keep_order: args.keep_order,
114-
tty_path: args.tty_path.clone(),
115-
title: args.title.clone(),
114+
tty_path: args.tty_path,
115+
title: args.title,
116+
window_uid: args.window_uid,
116117
scorers: VecDeque::new(),
117118
layout: args.layout.unwrap_or_else(|| {
118119
if args.preview_builder.is_some() {
@@ -273,6 +274,10 @@ pub struct Args {
273274
#[argh(option, default = "\"sweep\".to_string()")]
274275
pub title: String,
275276

277+
/// internal windows stack window identifier
278+
#[argh(option, from_str_fn(parse_value), default = "\"default\".into()")]
279+
pub window_uid: serde_json::Value,
280+
276281
/// candidates in JSON pre line format (same encoding as RPC)
277282
#[argh(switch)]
278283
pub json: bool,
@@ -302,6 +307,10 @@ pub struct Args {
302307
pub version: bool,
303308
}
304309

310+
fn parse_value(value: &str) -> Result<serde_json::Value, String> {
311+
serde_json::from_str(value).map_err(|error| error.to_string())
312+
}
313+
305314
fn parse_no_input(value: &str) -> Result<bool, String> {
306315
match value {
307316
"nothing" => Ok(false),

sweep-lib/src/candidate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ impl Candidate {
7070
/// - `right_face`: Default face for right fields
7171
/// - `preview`: Fields to be shown on preview [Haystack::preview]
7272
/// - `preview_flex`: Preview view flex value
73+
#[allow(clippy::too_many_arguments)]
7374
pub fn new(
7475
target: Vec<Field<'static>>,
7576
extra: Option<HashMap<String, Value>>,

0 commit comments

Comments
 (0)