Skip to main content

open_repo_view

Function open_repo_view 

Source
pub fn open_repo_view(
    view: &str,
    mode_id: &str,
    store: &BufferStoreHandle,
    scopes: &RepoScopes,
    active: BufferId,
) -> Effect
Expand description

MR.2: the single path from “a magit trigger fired” to “the buffer it opens” — resolve the repository, name the buffer for it, record which repository that buffer acts on.

Both surfaces call exactly this. C-x g reaches it from an action handler (which has services and a buffer id) and :magit-status from an ex-command closure (which has a buffer id and a handle it captured at boot). They had different reach before MR.2 and letting them diverge was never on the table: the same command meaning two things depending on how it was reached is worse than either meaning on its own.

active is the buffer the trigger fired in — ExCommandContext:: buffer_id or ActionContext::buffer_id, which are the same fact from the same dispatch.