pub struct RepoLens { /* private fields */ }Expand description
MR.6: which repository a picker is about.
The branch / commit / stash / ref pickers used to list
Repository::discover(".") — the process’s repository — so opening
one over a file from another checkout offered that checkout’s name
in the prompt and the wrong repository’s branches in the list.
PickerContext already carries the active buffer, so the answer is
the same one every other magit surface reaches for; these two handles
are what turn a buffer id into it. They arrive at registration
because a picker source is built at boot and PickerContext carries
no service registry — the same reason the ex-commands capture them.
Default (no handles) resolves from the active buffer’s path and
then the working directory, which is what a harness without a buffer
store gets and what magit did everywhere before MR.6.
Implementations§
Source§impl RepoLens
impl RepoLens
pub fn new(store: BufferStoreHandle, scopes: RepoScopesHandle) -> Self
Sourcepub fn workdir(&self, ctx: &PickerContext<'_>) -> PathBuf
pub fn workdir(&self, ctx: &PickerContext<'_>) -> PathBuf
The repository the picker’s rows belong to.
Resolved at init, before the listing goes off-thread: the
answer has to be captured into the spawned task, and a task that
asked afterwards would be asking about whatever buffer is active
by the time it runs.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RepoLens
impl !UnwindSafe for RepoLens
impl Freeze for RepoLens
impl Send for RepoLens
impl Sync for RepoLens
impl Unpin for RepoLens
impl UnsafeUnpin for RepoLens
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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