This package provides:
-
Made for Pulsar!
This package was written specifically for Pulsar and did not exist in the Atom package repository.
minimap-next
A preview of the full source code.
Fork of minimap.
Features
- Canvas rendering: Three-layer canvas (back decorations, tokens, front decorations) with incremental redraws — only changed row ranges are repainted.
- Syntax highlighting: Token colors are resolved directly from the active theme via computed DOM styles and cached per scope, so the minimap matches the editor exactly.
- Scroll past end: The minimap proportionally tracks the full editor scroll range, including the scroll-past-end zone.
- Decoration API: Uses the same marker-based API as
TextEditor— supportsline,gutter,highlight-under,highlight-over,highlight-outline, andbackground-custom/foreground-customtypes. - Plugin system: Third-party packages can consume the
minimap-nextservice to add their own decoration layers. - Quick settings: Toggle plugins and flip the minimap position via a dropdown on the minimap itself.
- Stand-alone mode: Embed a minimap preview outside of a text editor for custom UI panels.
- Independent scroll: Optionally decouple mouse-wheel scrolling on the minimap from the editor.
Installation
To install minimap-next search for minimap-next in the Install pane of the Pulsar settings or run ppm install minimap-next. Alternatively, you can run ppm install asiloisad/pulsar-minimap-next to install a package directly from the GitHub repository.
Provided Service minimap-next
Exposes the minimap API to other packages, allowing them to add decorations and interact with the minimap.
In your package.json:
{
"consumedServices": {
"minimap-next": {
"versions": { "1.0.0": "consumeMinimap" }
}
}
}
In your main module:
consumeMinimap(api) {
api.observeMinimaps((minimap) => {
const decoration = minimap.decorateMarker(marker, {
type: "line",
color: "#ff0000",
plugin: "my-plugin",
});
});
}
Customization
The style can be adjusted according to user preferences in the styles.less file:
- e.g. hide the default editor scrollbar:
atom-text-editor[with-minimap] .vertical-scrollbar {
display: none;
}
- e.g. change the minimap background:
atom-text-editor atom-text-editor-minimap {
background: green;
}
- e.g. change the visible area color:
atom-text-editor atom-text-editor-minimap .minimap-visible-area::after {
background-color: rgba(0, 255, 0, 0.5);
}
- e.g. show minimap only in the focused pane:
atom-text-editor {
atom-text-editor-minimap {
display: none;
}
&.is-focused {
atom-text-editor-minimap {
display: block;
}
}
}
Contributing
Got ideas to make this package better, found a bug, or want to help add new features? Just drop your thoughts on GitHub. Any feedback is welcome!