texstudio-org / texstudio-org/texstudio

Reload without discarding the undo stack

Open
#665 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
3.6k
Forks
403
Avg merge
3h 14m
Merged PRs (30d)
12

Description

Follow up to #659.

Currently, when reloading a file, we always drop the undo stack. But it would be better to keep it in the above context of external changes.

This is in principle possible since QDocument::setText(const QString& s, bool allowUndo) can be used with allowUndo. Essentially the task here is some reasonable refactoring so that the allowUndo information can be passed from reload() to setText().

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the reload() path and QDocument::setText(const QString& s, bool allowUndo), starting with how the allowUndo value is currently handled. Refactor the path so external-change reloads can preserve the undo stack, then verify that reloading still behaves correctly when the file has changed externally.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.