Skip to content

Commit 4d90a48

Browse files
committed
v0.2.72: Enable explorer with left/right position toggle
1 parent 19ff16a commit 4d90a48

5 files changed

Lines changed: 25 additions & 7 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.70 (6f291ac)
1+
0.2.72 (8c21f94)

imgui.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Window][Editor]
22
Pos=0,0
3-
Size=1655,830
3+
Size=941,820
44
Collapsed=0
55

66
[Window][DockSpace]

pcode-settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"window_w": 1655,
3-
"window_h": 830,
2+
"window_w": 941,
3+
"window_h": 820,
44
"dark_theme": true,
55
"show_status_bar": true,
66
"word_wrap": true,
@@ -13,5 +13,5 @@
1313
"font_size": 17,
1414
"font_name": "CascadiaMono",
1515
"last_open_dir": "C:\\Users\\casse\\github\\pcode-editor\\src",
16-
"recent_files": ["C:\\Users\\casse\\github\\pcode-editor\\src\\editor_app.h", ".\\BUILD_SYSTEM.md", "C:\\Users\\casse\\github\\pcode-editor\\src\\editor_app.cpp", "C:\\Users\\casse\\github\\pcode-editor\\src\\main.cpp"]
16+
"recent_files": ["C:\\Users\\casse\\github\\pcode-editor\\src\\editor_app.cpp", "C:\\Users\\casse\\github\\pcode-editor\\src\\editor_app.h", ".\\BUILD_SYSTEM.md", "C:\\Users\\casse\\github\\pcode-editor\\src\\main.cpp"]
1717
}

src/editor_app.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ std::string EditorApp::get_version() {
175175
} else {
176176
version = "BUG-merang!!!"; // fallback if VERSION file missing
177177
}
178-
return "pCode Editor version " + version;
178+
return "pCode Editor version 0.2.70 (6f291ac)" + version;
179179
}
180180

181181
// ============================================================================
@@ -2127,6 +2127,14 @@ void EditorApp::render_menu_view() {
21272127
if (ImGui::MenuItem("Status Bar", nullptr, &sb)) toggle_status_bar();
21282128
bool exp = show_file_tree_;
21292129
if (ImGui::MenuItem("Explorer", nullptr, &exp)) toggle_explorer();
2130+
if (show_file_tree_) {
2131+
ImGui::Indent();
2132+
bool exp_left = settings_.explorer_left;
2133+
if (ImGui::MenuItem("Explorer: Left", nullptr, &exp_left)) settings_.explorer_left = true;
2134+
bool exp_right = !settings_.explorer_left;
2135+
if (ImGui::MenuItem("Explorer: Right", nullptr, &exp_right)) settings_.explorer_left = false;
2136+
ImGui::Unindent();
2137+
}
21302138
bool ww = settings_.word_wrap;
21312139
if (ImGui::MenuItem("Word Wrap", nullptr, &ww)) toggle_word_wrap();
21322140
bool tabs = settings_.show_tabs;
@@ -2360,6 +2368,15 @@ void EditorApp::render_editor_area() {
23602368
}
23612369
}
23622370

2371+
// Render explorer sidebar (left or right based on setting)
2372+
if (show_file_tree_) {
2373+
if (settings_.explorer_left) {
2374+
// Explorer on LEFT side - rendered BEFORE editor
2375+
render_sidebar();
2376+
ImGui::SameLine();
2377+
}
2378+
}
2379+
23632380
// Now scrollable editor content
23642381
ImGui::BeginChild("##EditorContent", ImVec2(-1, -1), false);
23652382

src/editor_app.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ struct AppSettings {
8484
bool show_minimap = false;
8585
bool show_spaces = false;
8686
bool show_tabs = false;
87+
bool explorer_left = true; // Explorer position: true=left, false=right
8788
int tab_size = 4;
8889
int font_size = 18;
8990
int highlight_line = 1; // 0=none, 1=background, 2=outline
@@ -277,7 +278,7 @@ EditorApp(int argc = 0, char* argv[] = nullptr);
277278
bool show_about_ = false;
278279

279280
// Sidebar panels
280-
bool show_file_tree_ = false;
281+
bool show_file_tree_ = true;
281282
bool show_git_changes_ = false;
282283
bool show_symbol_outline_ = false;
283284
std::string git_branch_ = "main";

0 commit comments

Comments
 (0)