Open MrPicklePinosaur opened 3 months ago
The current usage of cd_tools is to first query from the DirParseState, and then extract the module you desire.
cd_tools
DirParseState
fn prompt_right(state: State<DirParseState>, sh: &Shell) -> StyledBuf { let project_info = default_prompt(&state, sh); let git_branch = state .get_module_metadata::<Git>("git") .map(|git| format!("git:{}", git.branch)); ... }
There is no reason why we can't just inject Git state directly into shell State and query using
Git
fn prompt_right(git_state: State<Git>, sh: &Shell) -> StyledBuf { let git_branch = format!("git:{}", git_state.branch); ... }
The current usage of
cd_tools
is to first query from theDirParseState
, and then extract the module you desire.There is no reason why we can't just inject
Git
state directly into shell State and query using