mantish/ help / docs
Join the waitlist

Hide unchanged lines

Fold away code nobody touched, down to just the members that changed.

Last updated

A three-line fix in a two-thousand-line file should not mean scrolling past two thousand lines. With Hide unchanged lines on, Mantish folds away the code nobody touched and keeps only what you need to understand each change.

What to keep on screen

Hide byWhat stays visible
Lines around changes (default)A fixed number of lines either side of every change — 10 unless you change Unchanged context
Changed members onlyEvery method, property or other member a change touches. Everything else is hidden

Changed members only has two options of its own:

OptionWhen on
Show unchanged signaturesThe signature of every other member stays too, with its body folded away — the file keeps its shape
Show body when only the declaration changedA member whose declaration line alone changed — a renamed method, a class given a base type — is shown whole. Off by default: its unchanged body folds away with the rest

Whatever holds a change stays around it too: the line that opens the class, interface, import list or var ( … ) block it sits in, and the line that closes it. A changed import shows under its import ( or import { and above the ) or } that ends the list, with the rest of the list folded away. The same goes for code that belongs to no member: an entry added to a module-level GROUPS[…] = OrderedDict([ shows under that line and above its ]), a line changed inside a ScalaTest test("…") { … } under the test's header, a field added to a Protocol Buffers message under its message … {, an entry added to a component's computed: { under the export default { that holds it. A decorator or attribute shows with the signature it annotates, and a changed one brings that signature with it.

Markup reads the same way. In an HTML page or a Vue component every tag a change stands in stays around it — the line that opens it and its closing tag — and the rest of the markup folds away, so an attribute added to a component shows under that component's opening line and the tags above it, never with the whole template. The code of a <script> or a <style> is read as the JavaScript, TypeScript or CSS it is: a method changed in a component's options object shows whole, under methods: {, export default { and <script>.

Changed members only needs Mantish to understand the language. In a file it cannot read that way, it reads the braces alone when there are any — enough to keep a message … { or type … { over a change — and otherwise falls back to lines around changes by itself.

Folded lines

A fold of unchanged lines
A fold of unchanged lines

Each fold shows how many lines it hides and which ones.

  • Click it to reveal the next few lines, ⌘-click for more, Shift-click for all of them.
  • Show all opens the whole fold at once.
  • Hold ⌘ and hover it to preview the hidden lines without opening them — see Inline reveal for how to change that key.

In the terminal, move onto a fold and press ↵ to open all of it. The side-by-side view folds a line only when both sides hide it, so a signature kept on one side keeps its partner beside it.

Muted changes

Muted changes stay on screen by default, as grey landmarks, so you can see that something changed there. Switch on Collapse muted changes to fold them away with the unchanged code — see Muted changes.

Turn it on

AppWhere
Desktop appSettings › Diff › Unchanged lines, or ⋯ in the file header
JetBrainsIn development
TerminalS opens the diff settings — Hide unchanged lines, Hide by and its options, Collapse muted, Line count and range; za folds and unfolds the unchanged lines

In the desktop app, the command palette (⌘K) has Hide Unchanged Lines too. Hide unchanged lines is off by default.

Was this page helpful?