aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/command/client/search/interactive.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/turtle/src/command/client/search/interactive.rs')
-rw-r--r--crates/turtle/src/command/client/search/interactive.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/turtle/src/command/client/search/interactive.rs b/crates/turtle/src/command/client/search/interactive.rs
index a3d2cb79..380fc33b 100644
--- a/crates/turtle/src/command/client/search/interactive.rs
+++ b/crates/turtle/src/command/client/search/interactive.rs
@@ -52,7 +52,7 @@ use ratatui::crossterm::event::{
const TAB_TITLES: [&str; 2] = ["Search", "Inspect"];
-pub enum InputAction {
+pub(crate) enum InputAction {
Accept(usize),
AcceptInspecting,
Copy(usize),
@@ -66,33 +66,33 @@ pub enum InputAction {
}
#[derive(Clone)]
-pub struct InspectingState {
+pub(crate) struct InspectingState {
current: Option<HistoryId>,
next: Option<HistoryId>,
previous: Option<HistoryId>,
}
impl InspectingState {
- pub fn move_to_previous(&mut self) {
+ pub(crate) fn move_to_previous(&mut self) {
let previous = self.previous.clone();
self.reset();
self.current = previous;
}
- pub fn move_to_next(&mut self) {
+ pub(crate) fn move_to_next(&mut self) {
let next = self.next.clone();
self.reset();
self.current = next;
}
- pub fn reset(&mut self) {
+ pub(crate) fn reset(&mut self) {
self.current = None;
self.next = None;
self.previous = None;
}
}
-pub fn to_compactness(f: &Frame, settings: &Settings) -> Compactness {
+pub(crate) fn to_compactness(f: &Frame, settings: &Settings) -> Compactness {
if match settings.style {
crate::atuin_client::settings::Style::Auto => f.area().height < 14,
crate::atuin_client::settings::Style::Compact => true,
@@ -110,7 +110,7 @@ pub fn to_compactness(f: &Frame, settings: &Settings) -> Compactness {
#[expect(clippy::struct_field_names)]
#[expect(clippy::struct_excessive_bools)]
-pub struct State {
+pub(crate) struct State {
history_count: i64,
results_state: ListState,
switched_search_mode: bool,
@@ -124,7 +124,7 @@ pub struct State {
pending_vim_key: Option<char>,
original_input_empty: bool,
- pub inspecting_state: InspectingState,
+ pub(crate) inspecting_state: InspectingState,
keymaps: KeymapSet,
search: SearchState,
@@ -133,7 +133,7 @@ pub struct State {
}
#[derive(Clone, Copy)]
-pub enum Compactness {
+pub(crate) enum Compactness {
Ultracompact,
Compact,
Full,
@@ -231,7 +231,7 @@ impl State {
}
}
- pub fn initialize_keymap_cursor(&mut self, settings: &Settings) {
+ pub(crate) fn initialize_keymap_cursor(&mut self, settings: &Settings) {
match self.keymap_mode {
KeymapMode::Emacs => self.set_keymap_cursor(settings, "emacs"),
KeymapMode::VimNormal => self.set_keymap_cursor(settings, "vim_normal"),
@@ -240,7 +240,7 @@ impl State {
}
}
- pub fn finalize_keymap_cursor(&mut self, settings: &Settings) {
+ pub(crate) fn finalize_keymap_cursor(&mut self, settings: &Settings) {
match settings.keymap_mode_shell {
KeymapMode::Emacs => self.set_keymap_cursor(settings, "emacs"),
KeymapMode::VimNormal => self.set_keymap_cursor(settings, "vim_normal"),
@@ -1433,7 +1433,7 @@ struct Stdout {
}
impl Stdout {
- pub fn new(inline_mode: bool, no_mouse: bool) -> std::io::Result<Self> {
+ pub(crate) fn new(inline_mode: bool, no_mouse: bool) -> std::io::Result<Self> {
terminal::enable_raw_mode()?;
let mut writer = TerminalWriter::new()?;
@@ -1547,7 +1547,7 @@ fn compute_popup_placement(
clippy::too_many_lines,
clippy::cognitive_complexity
)]
-pub async fn history(
+pub(crate) async fn history(
query: &[String],
settings: &Settings,
mut db: impl Database,