1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-12-30 10:41:18 +01:00

feat(monaco): add vim mode

This commit is contained in:
2025-07-25 10:04:22 +02:00
committed by Jan Wyzula
parent a51ef04cdf
commit 627b49b33a
2 changed files with 19 additions and 0 deletions

View File

@@ -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."""

View File

@@ -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([])