pub struct StatusView(pub Arc<Mutex<StatusBufferState>>);Expand description
The status buffer’s MagitView — supplies gr’s body for buffers
magit-status-mode owns.
Tuple Fields§
§0: Arc<Mutex<StatusBufferState>>Trait Implementations§
Source§impl MagitView for StatusView
impl MagitView for StatusView
Source§fn visit_at_cursor(&self, cursor: Position) -> Option<Effect>
fn visit_at_cursor(&self, cursor: Position) -> Option<Effect>
MG.22: magit-status’s <CR> — the reason visit_at_cursor
exists on the trait at all.
magit-hunk-mode owns the chord now, but here it must keep
resolving rows that are not diff content: a staged file opens
its index blob, an unstaged one the live file, a stash toggles
its inline patch, a commit opens its buffer. Returning None
for anything classify_line does not recognise is what lets
the caller fall through to diff-path resolution — and what
keeps it from resolving a row against a previous entry’s
expanded diff.
Source§fn commit_at_cursor(&self, cursor: Position) -> Option<String>
fn commit_at_cursor(&self, cursor: Position) -> Option<String>
MG.20: the commit on the Recent-commits row under the cursor.
File and stash rows correctly yield None, so V on a staged
file does nothing rather than reverting an unrelated commit.
Source§fn stash_at_cursor(&self, cursor: Position) -> Option<usize>
fn stash_at_cursor(&self, cursor: Position) -> Option<usize>
The stash on the Stashes row under the cursor.
magit-status renders these with the SAME " stash@{N} msg"
row magit-stash-mode’s list uses (sections.rs and
magit_stash_mode::list_row), so both views share one parser
rather than growing a second idea of the format. File and
commit rows fail the stash@{ prefix and correctly yield
None, so p on a staged file pops nothing.
Source§fn diff_target(&self, path: &Path, cursor: Position) -> Option<Effect>
fn diff_target(&self, path: &Path, cursor: Position) -> Option<Effect>
MG.18c: the section an inline diff was expanded under says
which tree it was diffed against — run_show passes
--cached for a Staged entry and nothing for an Unstaged one,
so the header the diff sits below is the same fact, already on
screen.
Stashes and commits expand patches too, and those belong to
neither the index nor the worktree; None refuses hunk staging
there rather than applying a commit’s diff to the index.
MG.50: <CR> inside an inline diff.
This was the one view with no answer — <CR> in a magit-status
hunk fell to the trait default and did nothing at all, while the
same key in magit-diff or a revision opened the file.
Which version to open is the SECTION’s question, not the
buffer’s: a status buffer holds staged and unstaged diffs at
once, and they describe different content. diff_source already
answers it from the header above the cursor — the same seam
s / u / x use to decide which tree a hunk applies to, so
the version <CR> shows and the tree a hunk stages to can never
disagree.
Source§fn refresh_restoring(&self, site: HunkSite) -> Option<Effect>
fn refresh_restoring(&self, site: HunkSite) -> Option<Effect>
MG.18d: queue the restore, then refresh. The refresh consumes it
once it holds the rebuilt text — see [refresh_context].
Source§fn stage(&self, cursor: Position) -> Option<Effect>
fn stage(&self, cursor: Position) -> Option<Effect>
s — stage the file on the status entry line at cursor.
Source§fn stage_rows(&self, rows: RangeInclusive<u32>) -> Option<Effect>
fn stage_rows(&self, rows: RangeInclusive<u32>) -> Option<Effect>
Every distinct file the selected rows cover, staged in ONE task with ONE refresh.
Distinct because a file entry and its expanded inline diff are separate rows of the same file — a selection over both must not stage it twice — and because the same path can appear in both the staged and unstaged sections.
Source§fn workdir(&self) -> Option<PathBuf>
fn workdir(&self) -> Option<PathBuf>
Source§fn diff_source(&self, cursor: Position) -> Option<DiffSource>
fn diff_source(&self, cursor: Position) -> Option<DiffSource>
cursor came from. Read moreSource§fn unstage_rows(&self, rows: RangeInclusive<u32>) -> Option<Effect>
fn unstage_rows(&self, rows: RangeInclusive<u32>) -> Option<Effect>
u in Visual mode. Peer of Self::stage_rows.Source§fn argument_flags(&self) -> &'static [RemoteFlag]
fn argument_flags(&self) -> &'static [RemoteFlag]
D offers. Read moreAuto Trait Implementations§
impl Freeze for StatusView
impl RefUnwindSafe for StatusView
impl Send for StatusView
impl Sync for StatusView
impl Unpin for StatusView
impl UnsafeUnpin for StatusView
impl UnwindSafe for StatusView
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
§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