GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): Go to Line miscounts and cannot navigate outside a single raw code_block — textContent has no block separators and position mapping hard-codes +2 · Issue #745 · developing-today/code

id(web): Go to Line miscounts and cannot navigate outside a single raw code_block — textContent has no block separators and position mapping hard-codes +2 #745

New issue
Copy link
New issue
Copy link
Closed
#746
Closed
id(web): Go to Line miscounts and cannot navigate outside a single raw code_block — textContent has no block separators and position mapping hard-codes +2#745
#746
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 24, 2026
Issue body actions

Problem

Go to Line (Ctrl+G / Cmd+G) only works for a document that is a single raw-mode code_block. In every other mode the plugin is installed in, it miscounts lines and cannot navigate:

  • The plugin is added unconditionally for all modes in pkgs/id/web/src/editor.ts (createGotoLinePlugin() in the shared plugin list, after the raw/rich branch), so rich, markdown and plain documents all get it. Those modes use richSchema (paragraphs, headings, list items, code blocks as separate textblocks).
  • getLineCount (pkgs/id/web/src/goto-line.ts:19-27) counts \n characters in doc.textContent. ProseMirror's textContent concatenates textblocks with no separator, so block boundaries are invisible: a document of three paragraphs has textContent === "alphabetagamma" and counts as 1 line.
  • getLineStartPos (pkgs/id/web/src/goto-line.ts:30-61) maps a text offset to a document position with a hard-coded pos + 2, with a comment claiming rich mode is handled "via resolve" — there is no resolve; the +2 is only correct for doc > code_block > text with a single block. Each additional textblock adds its own position overhead, so even a correct count would land at the wrong position.

Evidence (verified on main d7f9973 with a temporary vitest probe driving the real plugin, removed after)

Rich schema, doc = three paragraphs alpha / beta / gamma:

  • doc.textContent is "alphabetagamma" (no newlines).
  • Opening the dialog shows placeholder Line # (1–1) and max=1 for a three-line document.
  • Entering 2 and pressing Enter does nothing: the id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines #712 strict validation rejects it as out of range, the dialog stays open and the selection does not move. Go to Line is effectively dead in rich/markdown/plain mode.

Raw schema, doc = two code_blocks (a\nb and c\nd, four lines total):

  • textContent is "a\nbc\nd" — the last line of the first block and the first line of the second are merged — and the dialog reports 3 lines instead of 4.

Dedup: #712 (closed) fixed invalid/out-of-range input handling for the single-block case; #718 (closed) fixed the dialog singleton across editor recreation. Neither touches line counting/position mapping outside a single code block. No open issue covers this.

Why it matters

Ctrl+G is installed and advertised in every editable mode, but outside a single raw code block it tells the user their document has one line (or merges block-boundary lines) and refuses every jump past it. Plain-text and markdown files — primary id use cases — are exactly the affected modes.

Acceptance criteria

  • Line counting and line-start positions are computed from the document structure (walking textblocks and their positions), not from doc.textContent offsets plus a constant.
  • A defined line semantics for non-raw modes (e.g. one line per textblock, plus \n-split lines inside code blocks) is implemented and documented in the module comment.
  • Regression tests: rich doc of several paragraphs (dialog range matches, Enter on line N moves the cursor to the start of the Nth paragraph); mixed doc (paragraph + multi-line code_block + paragraph); raw doc with two code_blocks counts all lines; existing single-code_block tests and the id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines #712 invalid-input tests still pass.
  • Or, if Go to Line is deliberately raw-only, the plugin is not installed (or cleanly no-ops with feedback) in rich/markdown/plain modes, and that restriction is tested — silently offering a broken dialog is the unacceptable part.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 24, 2026
  2. dezren39 commented on Oct 24, 2026

    @dezren39
    dezren39
    on Oct 24, 2026
    MemberAuthor
    More actions

    id train triage (2026-10-24): needs-decision — Muse: assign to Session A (phases 0-10 review); Go to Line miscounts outside a single raw code_block (editor.ts).

  3. dezren39
    closed this as completedin #746on Oct 24, 2026
  4. dezren39
    added a commit that references this issue on Oct 24, 2026

    fix(id-web): widen the goto-line test helper to accept both schemas

    e329f7d
  5. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.