![]() |
undoStudio
The IDE of the undoRT ecosystem
|
Which files are open, and which of them is only a preview. More...
#include <cstddef>#include <string>#include <vector>

Go to the source code of this file.
Classes | |
| struct | undoApp::OpenDocument |
| One file that is open. More... | |
| struct | undoApp::OpenOutcome |
| What opening a file did, so the caller knows what to put back. More... | |
| class | undoApp::OpenDocuments |
| The set of open files, at most one of them a preview. More... | |
| struct | undoApp::OpenDocuments::CloseOutcome |
| Close a document. More... | |
| struct | undoApp::OpenDocuments::DirtySummary |
| Close every document that has changes. More... | |
Namespaces | |
| namespace | undoApp |
Enumerations | |
| enum class | undoApp::DocKind { undoApp::None , undoApp::ST , undoApp::JSON , undoApp::Text , undoApp::Cpp } |
| Which backend a document belongs to. More... | |
Which files are open, and which of them is only a preview.
undoStudio opens one file at a time: opening a second one closed the first. The backends hold a single document each, so what is missing is not a tab bar but somewhere to record that several files are open at once and, for each, the state to put back when it is shown again.
This is that record, and it is deliberately free of ImGui and of the backends: the decisions worth checking are which tab a new file lands in and what happens to the one that was in it, and those are the ones that can quietly lose somebody's work.
The rule it implements is the one VS Code uses, and the reason for it is that a file manager makes opening files cheap. Clicking through twenty files to find the one you wanted would be intolerable if each click left a tab behind, so a file opened that way takes the single preview slot and the next one takes its place. A tab becomes permanent — pinned — the moment it earns it: you edit it, you open it deliberately rather than by browsing, or you move it.
A preview that has unsaved changes is pinned rather than dropped. Replacing it would throw those changes away, and doing that silently, on a gesture as ordinary as clicking the next file in a tree, is not something a file editor gets to do.