Add no-op to paste_actions

This commit is contained in:
Kovid Goyal
2023-11-30 19:54:01 +05:30
parent c064a2e559
commit 15eb03c5e2
2 changed files with 4 additions and 3 deletions

View File

@@ -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.
'''
)

View File

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