Skip to content

Do not reload text document if text was apened out-of-band? #365

@krassowski

Description

@krassowski

Problem

Reading files with logs when using jupyter-collaboration or jupyter-server-documents is difficult because the cursor, selection, and to some degree scroll position jumps back to the top as the logs get appended, e.g. with:

import time
for i in range(100_000):
    !echo "log {i}" >> logs.txt
    time.sleep(0.01)
Screencast.From.2025-11-26.13-49-23.mp4

Proposed Solution

Attempt to emit granular edits for changes to text file which are not complete rewrites even if the coarse set method is used.

Additional context

In previous PRs we solved this issue for notebooks:

We could use difflib.SequenceMatcher to solve this for text files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions