Step 82: minimap

This commit is contained in:
Bill
2026-02-09 09:14:47 -07:00
parent 8bad31e94c
commit c040f6f936
5 changed files with 126 additions and 3 deletions

View File

@@ -64,6 +64,7 @@ struct EditorState {
// Custom editor widget state
CodeEditorWidget codeWidget;
bool showWhitespace = false;
bool showMinimap = false;
void init() {
std::string defaultContent =
@@ -563,6 +564,7 @@ int main(int, char**) {
}
if (ImGui::BeginMenu("View")) {
ImGui::MenuItem("Show Whitespace", nullptr, &state.showWhitespace);
ImGui::MenuItem("Show Minimap", nullptr, &state.showMinimap);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Language")) {
@@ -667,6 +669,7 @@ int main(int, char**) {
opts.showWhitespace = state.showWhitespace;
opts.mode = &state.mode;
opts.enableFolding = true;
opts.showMinimap = state.showMinimap;
CodeEditorResult res = state.codeWidget.render("##editor",
state.editBuf, state.highlights, opts, avail, monoFont);