From 9e3a7eab0bd3e54345d03627a1fbe31e8b745660 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Fri, 16 Feb 2024 22:37:18 -0600 Subject: [PATCH] Fixing close bufer logic; imporoved error handling --- src/core/controllers/bridge_controller.py | 2 -- src/core/controllers/files_controller.py | 3 -- .../usr/share/newton/context_path/index.html | 2 +- .../resources/js/newton/events.js | 1 + .../resources/js/newton/ui-logic.js | 34 ++++++++++++++----- .../context_path/resources/js/newton/utils.js | 8 ++++- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/core/controllers/bridge_controller.py b/src/core/controllers/bridge_controller.py index a230e83..5e06603 100644 --- a/src/core/controllers/bridge_controller.py +++ b/src/core/controllers/bridge_controller.py @@ -48,8 +48,6 @@ class BridgeController: event_system.emit("post_file_to_ipc", file) case "save": event_system.emit(f"handle_file_event_{event.originator}", (event,)) - case "close": - event_system.emit(f"handle_file_event_{event.originator}", (event,)) case "load_buffer": event_system.emit(f"handle_file_event_{event.originator}", (event,)) case "load_file": diff --git a/src/core/controllers/files_controller.py b/src/core/controllers/files_controller.py index 7ea1ba1..0c75b28 100644 --- a/src/core/controllers/files_controller.py +++ b/src/core/controllers/files_controller.py @@ -62,7 +62,6 @@ class FilesController: except: fpath = path - print(fpath) gfile = Gio.File.new_for_path(fpath) try: @@ -80,8 +79,6 @@ class FilesController: if ftype and fname and fpath: event_system.emit(f"update_tab_{event.originator}", (event.fhash, fname,)) event_system.emit(f"updated_session_{event.originator}", (event.fhash, ftype, fname, fpath)) - case "close": - event_system.emit(f"close_tab_{event.originator}", (event.fhash)) case "load_buffer": self.load_buffer(event.fhash) # event_system.emit(f"add_tab_{event.originator}", (event.fhash, "buffer",)) diff --git a/user_config/usr/share/newton/context_path/index.html b/user_config/usr/share/newton/context_path/index.html index 495a773..03343e1 100644 --- a/user_config/usr/share/newton/context_path/index.html +++ b/user_config/usr/share/newton/context_path/index.html @@ -15,7 +15,7 @@
-