A new `copy_and_clear_or_interrupt` function

Fixes #2403
This commit is contained in:
Kovid Goyal
2020-02-28 21:17:05 +05:30
parent c763db94ce
commit 242d335095
4 changed files with 15 additions and 1 deletions

View File

@@ -1159,7 +1159,8 @@ to zero for all mappings, including the builtin ones.
g('shortcuts.clipboard') # {{{
k('copy_to_clipboard', 'kitty_mod+c', 'copy_to_clipboard', _('Copy to clipboard'), long_text=_('''
There is also a :code:`copy_or_interrupt` action that can be optionally mapped to :kbd:`Ctrl+c`.
It will copy only if there is a selection and send an interrupt otherwise.'''))
It will copy only if there is a selection and send an interrupt otherwise. Similarly, :code:`copy_and_clear_or_interrupt`
will copy and clear the selection or send an interrupt if there is no selection.'''))
if is_macos:
k('copy_to_clipboard', 'cmd+c', 'copy_to_clipboard', _('Copy to clipboard'), add_to_docs=False)
k('paste_from_clipboard', 'kitty_mod+v', 'paste_from_clipboard', _('Paste from clipboard'))