parent
d6267c30f6
commit
b6f1dd963d
@ -36,6 +36,7 @@ Changed
|
|||||||
- `:navigate increment/decrement` now preserves leading zeroes in URLs.
|
- `:navigate increment/decrement` now preserves leading zeroes in URLs.
|
||||||
- `general -> editor` can now also handle `{}` inside another argument (e.g. to open `vim` via `termite`)
|
- `general -> editor` can now also handle `{}` inside another argument (e.g. to open `vim` via `termite`)
|
||||||
- Improved performance when scrolling with many tabs open.
|
- Improved performance when scrolling with many tabs open.
|
||||||
|
- Shift-Insert now also pastes primary selection for prompts.
|
||||||
|
|
||||||
Fixed
|
Fixed
|
||||||
~~~~~
|
~~~~~
|
||||||
|
@ -42,6 +42,19 @@ class MinimalLineEditMixin:
|
|||||||
""")
|
""")
|
||||||
self.setAttribute(Qt.WA_MacShowFocusRect, False)
|
self.setAttribute(Qt.WA_MacShowFocusRect, False)
|
||||||
|
|
||||||
|
def keyPressEvent(self, e):
|
||||||
|
"""Override keyPressEvent to paste primary selection on Shift + Ins."""
|
||||||
|
if e.key() == Qt.Key_Insert and e.modifiers() == Qt.ShiftModifier:
|
||||||
|
try:
|
||||||
|
text = utils.get_clipboard(selection=True)
|
||||||
|
except utils.SelectionUnsupportedError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
e.accept()
|
||||||
|
self.insert(text)
|
||||||
|
return
|
||||||
|
super().keyPressEvent(e)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return utils.get_repr(self)
|
return utils.get_repr(self)
|
||||||
|
|
||||||
@ -98,19 +111,6 @@ class CommandLineEdit(QLineEdit):
|
|||||||
if mark:
|
if mark:
|
||||||
self.setSelection(self._promptlen, oldpos - self._promptlen)
|
self.setSelection(self._promptlen, oldpos - self._promptlen)
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
|
||||||
"""Override keyPressEvent to paste primary selection on Shift + Ins."""
|
|
||||||
if e.key() == Qt.Key_Insert and e.modifiers() == Qt.ShiftModifier:
|
|
||||||
try:
|
|
||||||
text = utils.get_clipboard(selection=True)
|
|
||||||
except utils.SelectionUnsupportedError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
e.accept()
|
|
||||||
self.insert(text)
|
|
||||||
return
|
|
||||||
super().keyPressEvent(e)
|
|
||||||
|
|
||||||
|
|
||||||
class _CommandValidator(QValidator):
|
class _CommandValidator(QValidator):
|
||||||
|
|
||||||
|
@ -58,6 +58,20 @@ Feature: Prompts
|
|||||||
And I run :leave-mode
|
And I run :leave-mode
|
||||||
Then the javascript message "Prompt reply: null" should be logged
|
Then the javascript message "Prompt reply: null" should be logged
|
||||||
|
|
||||||
|
|
||||||
|
# Shift-Insert with prompt (issue 1299)
|
||||||
|
|
||||||
|
@pyqt531_or_newer
|
||||||
|
Scenario: Pasting via shift-insert in prompt mode
|
||||||
|
When selection is supported
|
||||||
|
And I put "insert test" into the primary selection
|
||||||
|
And I open data/prompt/jsprompt.html
|
||||||
|
And I click the button
|
||||||
|
And I wait for a prompt
|
||||||
|
And I press the keys "<Shift-Insert>"
|
||||||
|
And I run :prompt-accept
|
||||||
|
Then the javascript message "Prompt reply: insert test" should be logged
|
||||||
|
|
||||||
@pyqt531_or_newer
|
@pyqt531_or_newer
|
||||||
Scenario: Using content -> ignore-javascript-prompt
|
Scenario: Using content -> ignore-javascript-prompt
|
||||||
When I set content -> ignore-javascript-prompt to true
|
When I set content -> ignore-javascript-prompt to true
|
||||||
|
Loading…
Reference in New Issue
Block a user