2026-02-28 19:48:41 -06:00
|
|
|
# Python imports
|
|
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
|
|
|
|
|
# Application imports
|
|
|
|
|
from libs.event_factory import Event_Factory, Code_Event_Types
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
from libs.dto.states import SourceViewStates
|
2026-02-28 19:48:41 -06:00
|
|
|
|
|
|
|
|
from plugins.plugin_types import PluginCode
|
|
|
|
|
|
|
|
|
|
from .telescope import Telescope
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
telescope = Telescope()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Plugin(PluginCode):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super(Plugin, self).__init__()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _controller_message(self, event: Code_Event_Types.CodeEvent):
|
|
|
|
|
if isinstance(event, Code_Event_Types.FocusedViewEvent):
|
|
|
|
|
...
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
elif isinstance(event, Code_Event_Types.AddedNewFileEvent):
|
|
|
|
|
telescope.list_box.add_row(event)
|
|
|
|
|
elif isinstance(event, Code_Event_Types.RemovedFileEvent):
|
|
|
|
|
telescope.list_box.remove_row(event)
|
|
|
|
|
elif isinstance(event, Code_Event_Types.FilePathSetEvent):
|
|
|
|
|
telescope.list_box.update_label(event)
|
2026-02-28 19:48:41 -06:00
|
|
|
|
|
|
|
|
def load(self):
|
|
|
|
|
window = self.request_ui_element("main-window")
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
|
|
|
|
|
telescope.map_parent_resize_event(window)
|
2026-02-28 19:48:41 -06:00
|
|
|
telescope.set_transient_for(window)
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
telescope.set_emit(self.emit)
|
2026-02-28 19:48:41 -06:00
|
|
|
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
event = Event_Factory.create_event("register_command",
|
2026-02-28 19:48:41 -06:00
|
|
|
command_name = "telescope",
|
|
|
|
|
command = Handler,
|
|
|
|
|
binding_mode = "released",
|
|
|
|
|
binding = "<Control>b"
|
|
|
|
|
)
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
self.emit_to("source_views", event)
|
2026-02-28 19:48:41 -06:00
|
|
|
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
event = Event_Factory.create_event(
|
|
|
|
|
"create_source_view",
|
|
|
|
|
state = SourceViewStates.INDEPENDENT
|
|
|
|
|
)
|
2026-02-28 19:48:41 -06:00
|
|
|
self.emit_to("source_views", event)
|
|
|
|
|
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
source_view = event.response
|
|
|
|
|
telescope.set_source_view(source_view)
|
|
|
|
|
|
|
|
|
|
event = Event_Factory.create_event(
|
|
|
|
|
"register_completer",
|
|
|
|
|
completer = source_view.get_completion()
|
|
|
|
|
)
|
|
|
|
|
self.emit_to("completion", event)
|
|
|
|
|
|
|
|
|
|
|
2026-02-28 19:48:41 -06:00
|
|
|
def run(self):
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Handler:
|
|
|
|
|
@staticmethod
|
|
|
|
|
def execute(
|
|
|
|
|
view: any,
|
|
|
|
|
*args,
|
|
|
|
|
**kwargs
|
|
|
|
|
):
|
|
|
|
|
logger.debug("Command: Telescope")
|
Clean up codebase and improve file loading
- Moved plugins to proper sub groups (autopairs, code_minimap, colorize, commentzar, info_bar, markdown_preview, prettify_json, search_replace, tabs_bar, telescope, toggle_source_view, lsp_client)
- Add filter_out_loaded_files to prevent opening already-loaded files
- Add INDEPENDENT source view state
- Fix cursor scroll position on buffer switch
- Fix signal blocking during file load
- Fix word boundary in completion provider
- Refactor code events into single events module
2026-03-08 00:51:28 -06:00
|
|
|
telescope.set_active_row( view.get_buffer() )
|
2026-02-28 19:48:41 -06:00
|
|
|
telescope.hide() if telescope.is_visible() else telescope.show()
|