Skip to content

Commit

Permalink
Support skipknowledge option
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Nov 26, 2023
1 parent 2a14ce7 commit b4f0f8c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ pub struct Output {
)]
rerun: Option<Duration>,

/// Whether to skip Alfred's knowledge for this output.
#[serde(rename = "skipknowledge", skip_serializing_if = "Option::is_none")]
skip_knowledge: Option<bool>,

/// Each row item.
items: Vec<Item>,
}
Expand Down Expand Up @@ -516,6 +520,16 @@ impl Output {
self
}

/// Set the skip knowledge value.
///
/// This allows you to set `uid` and preserve the item order while allowing
/// Alfred to retain knowledge of your items, like your current selection
/// during a re-run.
pub fn skip_knowledge(&mut self, skip_knowledge: bool) -> &mut Self {
self.skip_knowledge = Some(skip_knowledge);
self
}

/// Extend the list of items to output.
pub fn items<I>(&mut self, iter: I) -> &mut Self
where
Expand Down

0 comments on commit b4f0f8c

Please sign in to comment.