Skip to content
Permalink
Browse files

another fix to mouse event:

- prevents paste text if cursor is not in edition zone
  • Loading branch information
slarosa committed Oct 6, 2012
1 parent 50c28a9 commit ea7f34ad27faebd098f713777989c4278a99fbf1
Showing with 11 additions and 6 deletions.
  1. +11 −6 python/console_sci.py
@@ -437,13 +437,18 @@ def mousePressEvent(self, e):
Re-implemented to handle the mouse press event.
e: the mouse press event (QMouseEvent)
"""
if e.button() == Qt.MidButton:
stringSel = unicode(QApplication.clipboard().text(QClipboard.Selection))
self.insertFromDropPaste(stringSel)
self.setFocus()
e.accept()
linenr, index = self.getCurLine()
## Prevents paste text if cursor is not in edition zone
if not self.is_cursor_on_last_line() or index < 4:
self.move_cursor_to_end()
else:
QsciScintilla.mousePressEvent(self, e)
if e.button() == Qt.MidButton:
stringSel = unicode(QApplication.clipboard().text(QClipboard.Selection))
self.insertFromDropPaste(stringSel)
self.setFocus()
e.accept()
else:
QsciScintilla.mousePressEvent(self, e)

def paste(self):
"""Reimplement QScintilla method"""

0 comments on commit ea7f34a

Please sign in to comment.
You can’t perform that action at this time.