Major completion provider overhaul; pluigin load and pattern improvements; css overhaul/cleanup; source view state modes added
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from libs.singleton import Singleton
|
||||
from ..singleton import Singleton
|
||||
|
||||
from ..dto.base_event import BaseEvent
|
||||
|
||||
@@ -25,7 +25,7 @@ class ControllerBase(Singleton, EmitDispatcher):
|
||||
|
||||
|
||||
def _controller_message(self, event: BaseEvent):
|
||||
raise ControllerBaseException("Controller Base must override '_controller_message'...")
|
||||
raise ControllerBaseException("Controller Base '_controller_message' must be overridden...")
|
||||
|
||||
def set_controller_context(self, controller_context: ControllerContext):
|
||||
self.controller_context = controller_context
|
||||
|
||||
@@ -24,7 +24,7 @@ class ControllerManager(Singleton, dict):
|
||||
def _crete_controller_context(self) -> ControllerContext:
|
||||
controller_context = ControllerContext()
|
||||
controller_context.message_to = self.message_to
|
||||
controller_context.message = self.message
|
||||
controller_context.message = self.message
|
||||
|
||||
return controller_context
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
|
||||
from .code_event import CodeEvent
|
||||
from .register_provider_event import RegisterProviderEvent
|
||||
|
||||
from .get_command_system_event import GetCommandSystemEvent
|
||||
from .request_completion_event import RequestCompletionEvent
|
||||
from .cursor_moved_event import CursorMovedEvent
|
||||
@@ -18,6 +20,7 @@ from .added_new_file_event import AddedNewFileEvent
|
||||
from .swapped_file_event import SwappedFileEvent
|
||||
from .popped_file_event import PoppedFileEvent
|
||||
from .removed_file_event import RemovedFileEvent
|
||||
from .saved_file_event import SavedFileEvent
|
||||
|
||||
from .get_file_event import GetFileEvent
|
||||
from .get_swap_file_event import GetSwapFileEvent
|
||||
|
||||
19
src/libs/dto/code/register_provider_event.py
Normal file
19
src/libs/dto/code/register_provider_event.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('GtkSource', '4')
|
||||
|
||||
from gi.repository import GtkSource
|
||||
|
||||
# Application imports
|
||||
from ..base_event import BaseEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class RegisterProviderEvent(BaseEvent):
|
||||
provider_name: str = ""
|
||||
provider: GtkSource.CompletionProvider = None
|
||||
language_ids: list = field(default_factory=lambda: [])
|
||||
13
src/libs/dto/code/saved_file_event.py
Normal file
13
src/libs/dto/code/saved_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class SavedFileEvent(CodeEvent):
|
||||
...
|
||||
@@ -2,6 +2,11 @@
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
|
||||
gi.require_version('Gtk', '3.0')
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
@@ -10,6 +15,6 @@ from .code_event import CodeEvent
|
||||
|
||||
@dataclass
|
||||
class TextInsertedEvent(CodeEvent):
|
||||
line: int = 0
|
||||
char: int = 0
|
||||
value: str = ""
|
||||
location: Gtk.TextIter = None
|
||||
text: str = ""
|
||||
length: int = 0
|
||||
|
||||
7
src/libs/dto/states/__init__.py
Normal file
7
src/libs/dto/states/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
"""
|
||||
Code DTO States Package
|
||||
"""
|
||||
|
||||
from .source_view_states import SourceViewStates
|
||||
from .cursor_action import CursorAction
|
||||
from .move_direction import MoveDirection
|
||||
14
src/libs/dto/states/cursor_action.py
Normal file
14
src/libs/dto/states/cursor_action.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Python imports
|
||||
from enum import Enum
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
class CursorAction(Enum):
|
||||
NONE = 0
|
||||
DELETE = 1
|
||||
BACKSPACE = 2
|
||||
ENTER = 3
|
||||
15
src/libs/dto/states/move_direction.py
Normal file
15
src/libs/dto/states/move_direction.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from enum import Enum
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
class MoveDirection(Enum):
|
||||
NONE = 0
|
||||
UP = 1
|
||||
DOWN = 2
|
||||
LEFT = 3
|
||||
RIGHT = 4
|
||||
14
src/libs/dto/states/source_view_states.py
Normal file
14
src/libs/dto/states/source_view_states.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Python imports
|
||||
from enum import Enum
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
class SourceViewStates(Enum):
|
||||
INSERT = 0
|
||||
MULTIINSERT = 1
|
||||
COMMAND = 2
|
||||
READONLY = 3
|
||||
@@ -39,4 +39,5 @@ class WebkitUISettings(WebKit2.Settings):
|
||||
self.set_enable_webaudio(True)
|
||||
self.set_enable_accelerated_2d_canvas(True)
|
||||
|
||||
self.set_user_agent(f"{APP_NAME}")
|
||||
self.set_user_agent(f"Mozilla/5.0 (macOS, AArch64) {APP_NAME}/1.0 Chrome/140.0.0 AppleWebKit/537.36 Safari/537.36")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user