texstudio-org / texstudio-org/texstudio
Reload without discarding the undo stack
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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