Refactor controller architecture and multi-insert state

- Rename ControllerContext to ControllerMessageBus for clarity
- Switch ControllerBase to use SingletonRaised
- Replace MarkEventsMixin with MarkerManager for multi-cursor editing
- Add populate_popup event support for source view context menus
- Remove unused swap file events
- Moved JSON prettify feature to plugin
- Fix event name: "removed_file" -> "remove_file"
This commit is contained in:
2026-02-28 01:10:28 -06:00
parent b724d41f6c
commit 1447a68fb0
28 changed files with 561 additions and 395 deletions
+6 -6
View File
@@ -15,18 +15,18 @@ class SingletonError(Exception):
T = TypeVar('T', bound='Singleton')
class Singleton:
_instance = None
__instance = None
def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T:
if cls._instance is not None:
if cls.__instance is not None:
logger.debug(f"'{cls.__name__}' is a Singleton. Returning instance...")
return cls._instance
return cls.__instance
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance
cls.__instance = super(Singleton, cls).__new__(cls)
return cls.__instance
def __init__(self) -> None:
if self._instance is not None:
if self.__instance is not None:
return
super(Singleton, self).__init__()