From 8241cdc331f5e46e89e2fb29f005e12df5a26654 Mon Sep 17 00:00:00 2001 From: Saul Pwanson Date: Fri, 20 Oct 2023 14:52:08 -0700 Subject: [PATCH] [commands] allow space-separated keystrokes #2067 --- visidata/cmdlog.py | 2 +- visidata/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/visidata/cmdlog.py b/visidata/cmdlog.py index 7c7894129..3d2aa0952 100644 --- a/visidata/cmdlog.py +++ b/visidata/cmdlog.py @@ -471,7 +471,7 @@ def repeat_for_selected(cmdlog, r): globalCommand('^V', 'show-version', 'status(__version_info__);', 'Show version and copyright information on status line') globalCommand('z^V', 'check-version', 'checkVersion(input("require version: ", value=__version_info__))', 'check VisiData version against given version') -globalCommand(' ', 'exec-longname', 'exec_longname(inputLongname())', 'execute command by its longname') +BaseSheet.addCommand('Space', 'exec-longname', 'exec_longname(inputLongname())', 'execute command by its longname') CommandLog.addCommand('x', 'replay-row', 'vd.replayOne(cursorRow); status("replayed one row")', 'replay command in current row') CommandLog.addCommand('gx', 'replay-all', 'vd.replay(sheet)', 'replay contents of entire CommandLog') diff --git a/visidata/settings.py b/visidata/settings.py index 8bbb26011..a9a0b1195 100644 --- a/visidata/settings.py +++ b/visidata/settings.py @@ -313,7 +313,7 @@ def addCommand(cls, keystrokes, longname, execstr, helpstr='', **kwargs): ''' vd.commands.set(longname, Command(longname, execstr, helpstr=helpstr, module=vd.importingModule, **kwargs), cls) if keystrokes: - vd.bindkeys.set(vd.prettykeys(keystrokes), longname, cls) + vd.bindkeys.set(vd.prettykeys(keystrokes.replace(' ', '')), longname, cls) return longname def _command(cls, binding, longname, helpstr, **kwargs):