Paste clipboard with :paste-primary on Windows
This commit is contained in:
parent
ddc1f803c0
commit
4d9a98a11d
@ -1400,7 +1400,7 @@ class CommandDispatcher:
|
|||||||
try:
|
try:
|
||||||
sel = utils.get_clipboard(selection=True)
|
sel = utils.get_clipboard(selection=True)
|
||||||
except utils.SelectionUnsupportedError:
|
except utils.SelectionUnsupportedError:
|
||||||
return
|
sel = utils.get_clipboard()
|
||||||
|
|
||||||
log.misc.debug("Pasting primary selection into element {}".format(
|
log.misc.debug("Pasting primary selection into element {}".format(
|
||||||
elem.debug_text()))
|
elem.debug_text()))
|
||||||
|
@ -202,6 +202,13 @@ def selection_supported(qapp):
|
|||||||
pytest.skip("OS doesn't support primary selection!")
|
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 '
|
@bdd.when(bdd.parsers.re(r'I put "(?P<content>.*)" into the '
|
||||||
r'(?P<what>primary selection|clipboard)'))
|
r'(?P<what>primary selection|clipboard)'))
|
||||||
def fill_clipboard(quteproc, httpbin, what, content):
|
def fill_clipboard(quteproc, httpbin, what, content):
|
||||||
|
@ -276,3 +276,14 @@ Feature: Yanking and pasting.
|
|||||||
And I run :enter-mode insert
|
And I run :enter-mode insert
|
||||||
And I run :paste-primary
|
And I run :paste-primary
|
||||||
Then the error "Focused element is not editable!" should be shown
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user