pub struct FileSearchState {
pub query: String,
pub at_offset: usize,
pub hidden_mode: bool,
pub results: Vec<FileSearchResult>,
pub selected: usize,
pub index: Vec<String>,
pub line_mode: bool,
}Expand description
State for the active file-search dropdown. Stored in
RenderState.file_search while the picker is open.
Fields§
§query: StringThe query text typed after @ (excluding @ and any ! prefix).
at_offset: usizeByte offset of the @ trigger in the input buffer.
Whether hidden files are included in the results.
results: Vec<FileSearchResult>Current ranked results.
selected: usizeCurrently-selected result index (wraps on navigation).
index: Vec<String>Cached workspace file list. Built once on open, re-filtered per query.
line_mode: boolWhether the line-range sub-mode is active (user typed : or Ctrl+L).
Implementations§
Source§impl FileSearchState
impl FileSearchState
Sourcepub fn refresh(&mut self, query: &str)
pub fn refresh(&mut self, query: &str)
Re-filter the index by query. Resets selection to the top result.
Sourcepub fn selected_result(&self) -> Option<&FileSearchResult>
pub fn selected_result(&self) -> Option<&FileSearchResult>
The currently-selected result, if any.
Toggle hidden-file display and rebuild the index.
Trait Implementations§
Source§impl Clone for FileSearchState
impl Clone for FileSearchState
Source§fn clone(&self) -> FileSearchState
fn clone(&self) -> FileSearchState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileSearchState
impl RefUnwindSafe for FileSearchState
impl Send for FileSearchState
impl Sync for FileSearchState
impl Unpin for FileSearchState
impl UnsafeUnpin for FileSearchState
impl UnwindSafe for FileSearchState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more