Fix bug where pasting does not work properly
@@ -1272,20 +1272,6 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
self._control.setTextCursor(self._get_prompt_cursor())
intercepted = True
- #------ Special sequences ----------------------------------------------
-
- elif event.matches(QtGui.QKeySequence.Copy):
- self.copy()
- intercepted = True
-
- elif event.matches(QtGui.QKeySequence.Cut):
- self.cut()
- intercepted = True
-
- elif event.matches(QtGui.QKeySequence.Paste):
- self.paste()
- intercepted = True
-
#------ No modifiers ---------------------------------------------------
else:
@@ -1431,6 +1417,21 @@ class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, superQ
intercepted = (not self._in_buffer(anchor) or
not self._in_buffer(position))
+ #------ Special sequences ----------------------------------------------
+
+ if not intercepted:
+ if event.matches(QtGui.QKeySequence.Copy):
+ self.copy()
+ intercepted = True
+
+ elif event.matches(QtGui.QKeySequence.Cut):
+ self.cut()
+ intercepted = True
+
+ elif event.matches(QtGui.QKeySequence.Paste):
+ self.paste()
+ intercepted = True
+
# Don't move the cursor if Control/Cmd is pressed to allow copy-paste
# using the keyboard in any part of the buffer. Also, permit scrolling
# with Page Up/Down keys. Finally, if we're executing, don't move the
