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:
@@ -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."""
|
||||
|
||||
@@ -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([])
|
||||
|
||||
Reference in New Issue
Block a user