Skip to content

Bookmark a specific line/selection, not just a whole file #42

Description

@Wikid82

Problem

Bookmarks are file-level only (`toBookmark` captures a `uri` and `relativePath`, nothing about cursor position). For large files, users often want to jump back to where they were, not just which file they were in — closer to how VS Code's built-in "Bookmarks" concept or line-level breakpoints work.

Proposal

  • Optionally capture the active selection/line when adding a bookmark (`editor.selection`).
  • Store an optional `line: number` (and maybe `column`) on `Bookmark`.
  • On `openBookmark`, reveal and select that line if present, otherwise open the file as today.
  • Keep this opt-in (e.g. a separate "Bookmark Current Line" command) so the default whole-file behavior is unchanged.

Notes

This is a bigger feature than the others — likely worth designing as its own bookmark "kind" (file vs. line) rather than overloading the existing type silently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions