Skip to main content

Module magit_nav_mode

Module magit_nav_mode 

Source
Expand description

magit-nav-mode — the magit chords that are safe in ANY buffer.

§Why this is split from magit-core-mode

magit-core-mode claims bare letters — i, C, D, S, U, q, yr — and its own doc explains what makes that legitimate: every major it attaches to is a read-only list, so those letters shadow nothing the user could otherwise be doing. magit-commit-mode is excluded by name for exactly that reason; listing it made i open the .gitignore prompt instead of entering Insert, and a commit message became untypeable.

That rule is enforced by ActivationPolicy::Majors, which is an explicit list. It is NOT enforced for a mode that reaches magit-core-mode through Mode::implies — and magit-project-diff-mode did exactly that, so the editable cross-file diff inherited every one of those letters. i did not insert.

Rather than override them back one by one — a subtractive rule written additively, whose override list would have to track magit-core-mode forever — the four chords that are actually universal move here. magit-core-mode implies this mode, so read-only views are unchanged; an editable magit view implies THIS one and never sees the letters.

The distinction is what each chord assumes, not which buffer wants it: navigating sections and folding are meaningful wherever there are sections; i/C/D/S assume nothing is editable.

Structs§

MagitNavMode

Functions§

register_magit_nav_mode