From 36fc25fb7e5478e1e8a20b39750bf485803061d8 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 24 Mar 2025 20:43:34 -0500 Subject: [PATCH] [studio] Fix closing tab with unsaved changes --- deps/buildcore/scripts/file-to-cpp.py | 30 ++++++++++++++++++++++ src/olympic/studio/applib/src/studioui.cpp | 1 + 2 files changed, 31 insertions(+) create mode 100755 deps/buildcore/scripts/file-to-cpp.py diff --git a/deps/buildcore/scripts/file-to-cpp.py b/deps/buildcore/scripts/file-to-cpp.py new file mode 100755 index 00000000..057976af --- /dev/null +++ b/deps/buildcore/scripts/file-to-cpp.py @@ -0,0 +1,30 @@ +#! /usr/bin/env python3 + +# +# Copyright 2016 - 2025 gary@drinkingtea.net +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +import argparse +import sys + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument('--file', help='path to file') + parser.add_argument('--out-cpp', help='path to output cpp file') + parser.add_argument('--out-hpp', help='path to output hpp file') + parser.add_argument('--namespace', help='path to output hpp file') + args = parser.parse_args() + return 0 + + +if __name__ == '__main__': + try: + err = main() + sys.exit(err) + except KeyboardInterrupt: + sys.exit(1) diff --git a/src/olympic/studio/applib/src/studioui.cpp b/src/olympic/studio/applib/src/studioui.cpp index e3e3beb0..ee549af6 100644 --- a/src/olympic/studio/applib/src/studioui.cpp +++ b/src/olympic/studio/applib/src/studioui.cpp @@ -254,6 +254,7 @@ void StudioUI::drawTabs() noexcept { if (!open) { if (e->unsavedChanges()) { m_closeFileConfirm.open(); + ++it; } else { e->close(); if (m_activeEditor == (*it).get()) {