diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 68aa2c4a..ec80d5d2 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -2542,6 +2542,15 @@ class MonacoWidget(RPCBase): enabled (bool): If True, the minimap will be enabled; otherwise, it will be disabled. """ + @rpc_call + def set_vim_mode_enabled(self, enabled: bool) -> None: + """ + Enable or disable Vim mode in the Monaco editor. + + Args: + enabled (bool): If True, Vim mode will be enabled; otherwise, it will be disabled. + """ + class MotorMap(RPCBase): """Motor map widget for plotting motor positions in 2D including a trace of the last points.""" diff --git a/bec_widgets/widgets/editors/monaco/monaco_widget.py b/bec_widgets/widgets/editors/monaco/monaco_widget.py index 06ef503d..7c093c2c 100644 --- a/bec_widgets/widgets/editors/monaco/monaco_widget.py +++ b/bec_widgets/widgets/editors/monaco/monaco_widget.py @@ -27,6 +27,7 @@ class MonacoWidget(BECWidget, QWidget): "set_cursor", "current_cursor", "set_minimap_enabled", + "set_vim_mode_enabled", ] def __init__(self, parent=None, config=None, client=None, gui_id=None, **kwargs): @@ -157,6 +158,15 @@ class MonacoWidget(BECWidget, QWidget): """ self.editor.clear_highlighted_lines() + def set_vim_mode_enabled(self, enabled: bool) -> None: + """ + Enable or disable Vim mode in the Monaco editor. + + Args: + enabled (bool): If True, Vim mode will be enabled; otherwise, it will be disabled. + """ + self.editor.set_vim_mode_enabled(enabled) + if __name__ == "__main__": # pragma: no cover qapp = QApplication([])