Bookmarks are a great way of navigating to the right spots. You can set temporary and permanent bookmarks.
Setting, Editing, and Removing Temporary Bookmarks
To set a temporary bookmark, set the caret to the desired bookmark position, then press CTRL+F7. A green rectangle appears in the debugger margin and indicates that this line contains a temporary bookmark.
You can set one temporary bookmark per line. If a line already contains a bookmark, and you press CTRL+F7, the existing bookmark is removed. CTRL+F7 really works like a bookmark toggle.
Bookmark toggling (pressing CTRL+F7 repeatedly) works per line, not per position, so the caret can be anywhere inside a line to remove a bookmark in this line.
Setting new bookmarks is position-specific. A bookmark is bound to the caret position when it is created, and will be updated accordingly. So if you continue to edit your document, and append or remove text, the bookmark position is recalculated in real-time and always brings you back to the original document position when the bookmark was created.
Navigating to Bookmarks
To navigate to the closest bookmark, press F7. The caret is moved to the bookmark, and ISESteroids scrolls the bookmark position into view.
Press SHIFT+F7 to navigate to the previous bookmark.
Temporary bookmarks work across multiple documents and tabs. So when you set bookmarks in multiple open documents and press F7 repeatedly, ISESteroids navigates to all bookmarks and switches editors and positions accordingly.
Temporary Bookmark Storage
All temporary bookmarks are defined in memory, and are persisted to an NTFS stream. When you close and re-open a document containing temporary bookmarks, the temporary bookmarks are still there – provided your document was stored on an NTFS-formatted drive.
If you move your file to a non-NTFS location – like a USB-stick, wrapped inside a ZIP-file, a network location, or sent as Email-Attachment – your bookmark definitions are lost. So when a file is passed to someone else, temporary bookmarks are automatically removed.
To keep bookmarks always tied to a script, you can also define permanent bookmarks. They are defined as part of your script.
Permanent bookmarks are just comments with a special formatting that gets picked up by ISESteroids bookmark manager:
<#bookmark Some text #>
IMPORTANT: the text you place inside the bookmark comment statement (like “Some text” in the example above) must only contain alphanumerical characters. Do not use special characters such as commas etc. This would break the comment pattern, and the comment would no longer be picked up by the bookmark manager.
To manage and navigate to permanent bookmarks, click the bookmark icon in the secondary toolbar. This brings up a bookmark list with permanent bookmarks, and when you click a permanent bookmark in this list, ISESteroids takes you to the bookmark comment.
When the bookmark panel slides in at the bottom side of the editor, it will auto-hide again when you click the editor or switch to another editor.
To keep the panel open, pin it by clicking the “Pin” icon on the right side of its title bar. When the panel is pinned, it gives you an excellent overview of your permanent bookmarks. The list is updated in real-time, so when you add or remove permanent breakpoints, the list is updated momentarily.
NOTE: Temporary and permanent bookmarks currently are two separate feature implementations. It is planned to merge them together for more consistency. In a future release, permanent bookmarks will also show an indicator in the debugger margin, can be navigated by pressing F7, and the bookmark list will also list temporary bookmarks.