Paste clipboard with :paste-primary on Windows

This commit is contained in:
Florian Bruhin 2016-05-08 21:18:30 +02:00
parent ddc1f803c0
commit 4d9a98a11d
3 changed files with 19 additions and 1 deletions

View File

@ -1400,7 +1400,7 @@ class CommandDispatcher:
try:
sel = utils.get_clipboard(selection=True)
except utils.SelectionUnsupportedError:
return
sel = utils.get_clipboard()
log.misc.debug("Pasting primary selection into element {}".format(
elem.debug_text()))

View File

@ -202,6 +202,13 @@ def selection_supported(qapp):
pytest.skip("OS doesn't support primary selection!")
@bdd.when("selection is not supported")
def selection_not_supported(qapp):
"""Skip the test if selection is supported."""
if qapp.clipboard().supportsSelection():
pytest.skip("OS supports primary selection!")
@bdd.when(bdd.parsers.re(r'I put "(?P<content>.*)" into the '
r'(?P<what>primary selection|clipboard)'))
def fill_clipboard(quteproc, httpbin, what, content):

View File

@ -276,3 +276,14 @@ Feature: Yanking and pasting.
And I run :enter-mode insert
And I run :paste-primary
Then the error "Focused element is not editable!" should be shown
Scenario: :paste-primary without primary selection supported
When selection is not supported
And I open data/paste_primary.html
And I put "Hello world" into the clipboard
# Click the text field
And I run :hint all
And I run :follow-hint a
And I run :paste-primary
# Compare
Then the text field should contain "Hello world"