From 9310b42d9f2d29428223b2cec656f69c6812382c Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 20 May 2026 20:16:30 -0700 Subject: [PATCH] Add a few more browse action bindings. --- borgmatic/actions/browse/view.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/borgmatic/actions/browse/view.py b/borgmatic/actions/browse/view.py index 7b049e4c..b665e84f 100644 --- a/borgmatic/actions/browse/view.py +++ b/borgmatic/actions/browse/view.py @@ -132,7 +132,16 @@ def load_file_preview(browse_app, file_preview, config, repository, archive_name browse_app.call_from_thread(file_preview.update, file_content) +OPTION_LIST_BINDINGS = textual.widgets.OptionList.BINDINGS + [ + textual.binding.Binding(key='j', action='cursor_down', description='down', show=False), + textual.binding.Binding(key='k', action='cursor_up', description='up', show=False), + textual.binding.Binding(key='right,l', action='select', description='select', show=False), +] + + class Configuration_files_list(textual.widgets.OptionList): + BINDINGS = OPTION_LIST_BINDINGS + def __init__(self, configs): self.configs = configs home_directory = os.path.expanduser('~') @@ -153,6 +162,8 @@ class Configuration_files_list(textual.widgets.OptionList): class Repositories_list(textual.widgets.OptionList): + BINDINGS = OPTION_LIST_BINDINGS + def __init__(self, config): self.config = config self.repositories = config['repositories'] @@ -172,6 +183,8 @@ class Repositories_list(textual.widgets.OptionList): class Archives_list(textual.widgets.OptionList): + BINDINGS = OPTION_LIST_BINDINGS + def __init__(self, config, repository): self.config = config self.repository = repository @@ -199,6 +212,8 @@ class Archives_list(textual.widgets.OptionList): class Directory_list(textual.widgets.OptionList): + BINDINGS = OPTION_LIST_BINDINGS + def __init__(self, config, repository, archive_name, path_components=None): self.config = config self.repository = repository @@ -346,7 +361,7 @@ class Logs(textual.widgets.RichLog): class Browse_app(textual.app.App): BINDINGS = [ textual.binding.Binding(key='q', action='quit', description='quit'), - textual.binding.Binding(key='l', action='toggle_logs', description='logs'), + textual.binding.Binding(key='v', action='toggle_logs', description='view logs'), textual.binding.Binding( key='c', action='command_palette', description='commands', show=False ),