@@ -899,10 +899,14 @@ void EditorApp::render_menu_file() {
899899 open_file (settings_.recent_files [i]);
900900 }
901901 }
902- ImGui::EndMenu ();
902+ ImGui::EndMenu ();
903903 }
904904 }
905905
906+ ImGui::Separator ();
907+ if (ImGui::MenuItem (" Save" , " Ctrl+S" )) save_tab (active_tab_);
908+ if (ImGui::MenuItem (" Save As..." , " Ctrl+Shift+S" )) save_tab_as (active_tab_);
909+ if (ImGui::MenuItem (" Save All" , " Ctrl+Alt+S" )) save_all ();
906910 ImGui::Separator ();
907911 // Page Setup — placeholder (requires native print dialog)
908912 if (ImGui::MenuItem (" Page Setup..." )) { /* TODO: native dialog */ }
@@ -1012,32 +1016,40 @@ void EditorApp::render_editor_area() {
10121016 new_tab ();
10131017 }
10141018
1015- // Tab bar
1016- ImGuiTabBarFlags tab_flags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_AutoSelectNewTabs;
1017- if (ImGui::BeginTabBar (" ##Tabs" , tab_flags)) {
1018- for (int i = 0 ; i < (int )tabs_.size (); i++) {
1019- auto & tab = tabs_[i];
1020- std::string label = tab.display_name ;
1021- if (tab.dirty ) label += " *" ;
1022-
1023- ImGuiTabItemFlags tab_item_flags = 0 ;
1024- if (i == active_tab_) tab_item_flags |= ImGuiTabItemFlags_SetSelected;
1025-
1026- bool open = true ;
1027- if (ImGui::BeginTabItem (label.c_str (), &open, tab_item_flags)) {
1028- active_tab_ = i;
1029-
1030- // Render gutter with bookmarks and change history
1031- render_editor_with_margins ();
1032-
1033- ImGui::EndTabItem ();
1034- }
1035- if (!open) {
1036- close_tab (i);
1037- break ;
1019+ // Tab bar - only show if more than one tab
1020+ bool show_tabs = tabs_.size () > 1 ;
1021+ if (show_tabs) {
1022+ ImGuiTabBarFlags tab_flags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_AutoSelectNewTabs;
1023+ if (ImGui::BeginTabBar (" ##Tabs" , tab_flags)) {
1024+ for (int i = 0 ; i < (int )tabs_.size (); i++) {
1025+ auto & tab = tabs_[i];
1026+ std::string label = tab.display_name ;
1027+ if (tab.dirty ) label += " *" ;
1028+
1029+ ImGuiTabItemFlags tab_item_flags = 0 ;
1030+ if (i == active_tab_) tab_item_flags |= ImGuiTabItemFlags_SetSelected;
1031+
1032+ bool open = true ;
1033+ if (ImGui::BeginTabItem (label.c_str (), &open, tab_item_flags)) {
1034+ active_tab_ = i;
1035+
1036+ // Render gutter with bookmarks and change history
1037+ render_editor_with_margins ();
1038+
1039+ ImGui::EndTabItem ();
1040+ }
1041+ if (!open) {
1042+ close_tab (i);
1043+ break ;
1044+ }
10381045 }
1046+ ImGui::EndTabBar ();
1047+ }
1048+ } else {
1049+ // Single tab - just render the editor directly
1050+ if (active_tab_ >= 0 && active_tab_ < (int )tabs_.size ()) {
1051+ render_editor_with_margins ();
10391052 }
1040- ImGui::EndTabBar ();
10411053 }
10421054
10431055 ImGui::End ();
0 commit comments