Skip to content

Commit 291dfd6

Browse files
committed
Fix: Restore command line, enable proper docking
1 parent 092f4ae commit 291dfd6

3 files changed

Lines changed: 51 additions & 28 deletions

File tree

imgui.ini

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[Window][Editor]
2-
Pos=253,26
3-
Size=1076,897
2+
Pos=0,26
3+
Size=1280,774
44
Collapsed=0
55
DockId=0x00000003,0
66

77
[Window][DockSpace]
88
Pos=0,0
9-
Size=1329,923
9+
Size=1280,800
1010
Collapsed=0
1111

1212
[Window][Debug##Default]
@@ -20,29 +20,26 @@ Size=501,229
2020
Collapsed=0
2121

2222
[Window][Explorer]
23-
Pos=0,26
24-
Size=251,897
23+
Pos=932,346
24+
Size=251,720
2525
Collapsed=0
26-
DockId=0x00000005,0
2726

2827
[Docking][Data]
29-
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,26 Size=1329,897 Split=X Selected=0xDF0EC458
30-
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=251,983 Selected=0x00F0E82E
31-
DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=1667,983 Split=X
32-
DockNode ID=0x00000011 Parent=0x00000006 SizeRef=1306,851 Split=Y
33-
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=1280,480 Split=Y
34-
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=1280,472 Split=Y
35-
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1280,720 Split=Y
36-
DockNode ID=0x00000009 Parent=0x0000000B SizeRef=1280,686 Split=Y
37-
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=1280,703 Split=Y
38-
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=1280,386 Selected=0x00F0E82E
39-
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=1280,261 Split=X
40-
DockNode ID=0x00000003 Parent=0x00000002 SizeRef=678,778 CentralNode=1 Selected=0xDF0EC458
41-
DockNode ID=0x00000004 Parent=0x00000002 SizeRef=600,778 Selected=0xD33228A6
42-
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=1280,64 HiddenTabBar=1 Selected=0x2AB9DED9
43-
DockNode ID=0x0000000A Parent=0x0000000B SizeRef=1280,81 HiddenTabBar=1 Selected=0x2AB9DED9
44-
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1280,47 HiddenTabBar=1 Selected=0x2AB9DED9
45-
DockNode ID=0x0000000E Parent=0x0000000F SizeRef=1280,300 Selected=0xD33228A6
46-
DockNode ID=0x00000010 Parent=0x00000011 SizeRef=1280,300 Selected=0xD33228A6
47-
DockNode ID=0x00000012 Parent=0x00000006 SizeRef=612,851 Selected=0xD33228A6
28+
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,26 Size=1280,774 Split=X Selected=0xDF0EC458
29+
DockNode ID=0x00000011 Parent=0xCCBD8CF7 SizeRef=1306,851 Split=Y
30+
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=1280,480 Split=Y
31+
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=1280,472 Split=Y
32+
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1280,720 Split=Y
33+
DockNode ID=0x00000009 Parent=0x0000000B SizeRef=1280,686 Split=Y
34+
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=1280,703 Split=Y
35+
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=1280,386 Selected=0x00F0E82E
36+
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=1280,261 Split=X
37+
DockNode ID=0x00000003 Parent=0x00000002 SizeRef=678,778 CentralNode=1 Selected=0xDF0EC458
38+
DockNode ID=0x00000004 Parent=0x00000002 SizeRef=600,778 Selected=0xD33228A6
39+
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=1280,64 HiddenTabBar=1 Selected=0x2AB9DED9
40+
DockNode ID=0x0000000A Parent=0x0000000B SizeRef=1280,81 HiddenTabBar=1 Selected=0x2AB9DED9
41+
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1280,47 HiddenTabBar=1 Selected=0x2AB9DED9
42+
DockNode ID=0x0000000E Parent=0x0000000F SizeRef=1280,300 Selected=0xD33228A6
43+
DockNode ID=0x00000010 Parent=0x00000011 SizeRef=1280,300 Selected=0xD33228A6
44+
DockNode ID=0x00000012 Parent=0xCCBD8CF7 SizeRef=612,851 Selected=0xD33228A6
4845

pcode-settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"font_size": 18,
1414
"font_name": "CascadiaMono",
1515
"last_open_dir": ".\\src",
16-
"recent_files": [".\\src\\editor_app.h", ".\\src\\editor_app.cpp", ".\\docs\\versioning.md", ".\\docs\\imgui_tutorial.md", ".\\docs\\VIM_MOTIONS_SPEC.md", "./src/editor_app.h", "./src/main.cpp", "./src/editor_app.cpp", "VERSION", "./CMakeLists.txt"]
16+
"recent_files": [".\\src\\editor_app.cpp", ".\\src\\editor_app.h", ".\\docs\\versioning.md", ".\\docs\\imgui_tutorial.md", ".\\docs\\VIM_MOTIONS_SPEC.md", "./src/editor_app.h", "./src/main.cpp", "./src/editor_app.cpp", "VERSION", "./CMakeLists.txt"]
1717
}

src/editor_app.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ void EditorApp::render() {
18041804
ImGui::PopStyleVar(3);
18051805

18061806
ImGuiID dockspace_id = ImGui::GetID("MainDockSpace");
1807-
ImGui::DockSpace(dockspace_id, ImVec2(0, 0), ImGuiDockNodeFlags_PassthruCentralNode);
1807+
ImGui::DockSpace(dockspace_id, ImVec2(0, 0), ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_DockSpace);
18081808
ImGui::DockBuilderDockWindow("Editor", dockspace_id);
18091809

18101810
render_menu_bar();
@@ -2953,7 +2953,33 @@ if (history_index_ > 0) {
29532953
}
29542954

29552955
void EditorApp::render_command_line() {
2956-
return;
2956+
if (vim_mode_ != VimMode::Command) return;
2957+
2958+
float cmd_height = 28;
2959+
ImVec2 editor_pos = ImGui::GetWindowPos();
2960+
float editor_width = ImGui::GetWindowWidth();
2961+
float editor_height = ImGui::GetWindowHeight();
2962+
2963+
ImGui::SetCursorPosY(editor_height - 24 - cmd_height);
2964+
2965+
ImDrawList* draw_list = ImGui::GetWindowDrawList();
2966+
ImU32 cmd_bg = ImColor(0.1f, 0.1f, 0.2f);
2967+
draw_list->AddRectFilled(
2968+
ImVec2(editor_pos.x, editor_pos.y + editor_height - cmd_height),
2969+
ImVec2(editor_pos.x + editor_width, editor_pos.y + editor_height),
2970+
cmd_bg);
2971+
2972+
ImGui::SetCursorPosY(editor_height - cmd_height);
2973+
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4, 4));
2974+
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.9f, 0.9f, 0.9f, 1.0f));
2975+
2976+
ImGui::Text(":");
2977+
ImGui::SameLine();
2978+
ImGui::SetNextItemWidth(editor_width - 40);
2979+
ImGui::InputText("##cmd", vim_command_input_, sizeof(vim_command_input_), ImGuiInputTextFlags_EnterReturnsTrue, nullptr, this);
2980+
2981+
ImGui::PopStyleColor();
2982+
ImGui::PopStyleVar();
29572983
}
29582984

29592985
#ifdef _WIN32

0 commit comments

Comments
 (0)