From 708b46d6c0ee0e4b18a9521bc5669195a10e77fd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 29 Mar 2017 11:31:05 +0200 Subject: [PATCH] Fix text with empty primary selection --- qutebrowser/utils/utils.py | 4 ++++ tests/end2end/features/yankpaste.feature | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 2aca78168..08ccaf3e8 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -54,6 +54,10 @@ class SelectionUnsupportedError(ClipboardError): """Raised if [gs]et_clipboard is used and selection=True is unsupported.""" + def __init__(self): + super().__init__("Primary selection is not supported on this " + "platform!") + class ClipboardEmptyError(ClipboardError): diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index 52c11ed22..bcc6a5451 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -99,6 +99,11 @@ Feature: Yanking and pasting. And I run :open {primary} (invalid command) Then the error "Primary selection is empty." should be shown + Scenario: Pasting without primary selection being supported + When selection is not supported + And I run :open {primary} (invalid command) + Then the error "Primary selection is not supported on this platform!" should be shown + Scenario: Pasting with a space in clipboard When I put " " into the clipboard And I run :open {clipboard} (invalid command)