From 15eb03c5e256abf32890a2becd6b43a36a292bfb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Nov 2023 19:54:01 +0530 Subject: [PATCH] Add no-op to paste_actions --- kitty/options/definition.py | 2 ++ kitty/options/utils.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 20fb6f7f6..55c799857 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -567,6 +567,8 @@ The supported paste actions are: Run the filter_paste() function from the file :file:`paste-actions.py` in the kitty config directory on the pasted text. The text returned by the function will be actually pasted. +:code:`no-op`: + Has no effect. ''' ) diff --git a/kitty/options/utils.py b/kitty/options/utils.py index ab7199a28..eb85346fa 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -940,11 +940,10 @@ def shell_integration(x: str) -> FrozenSet[str]: def paste_actions(x: str) -> FrozenSet[str]: - s = frozenset({'quote-urls-at-prompt', 'confirm', 'filter', 'confirm-if-large', 'replace-dangerous-control-codes', 'replace-newline'}) + s = frozenset({'quote-urls-at-prompt', 'confirm', 'filter', 'confirm-if-large', 'replace-dangerous-control-codes', 'replace-newline', 'no-op'}) q = frozenset(x.lower().split(',')) if not q.issubset(s): - log_error(f'Invalid paste actions: {q - s}, ignoring') - return (q & s) or frozenset({'invalid'}) + raise ValueError(f'Invalid paste actions: {q - s}, ignoring') return q