Commits

Steve Borho committed 2983b87

revset: fix return key behavior (closes #2104)

Comments (0)

Files changed (1)

tortoisehg/hgqt/revset.py

 
         self.entry = RevsetEntry(self)
         self.entry.addCompletions(logical, ancestry, _filepatterns, _common)
+        self.entry.returnPressed.connect(self.returnPressed)
         layout.addWidget(self.entry, 0)
 
         txt = _('<a href="http://www.selenic.com/mercurial/hg.1.html#revsets">'
         self.accept()
 
 class RevsetEntry(QsciScintilla):
+
+    returnPressed = pyqtSignal()
+
     def __init__(self, parent=None):
         super(RevsetEntry, self).__init__(parent)
         self.setMarginWidth(1, 0)
         if event.key() in (Qt.Key_Enter, Qt.Key_Return):
             if not self.isListActive():
                 event.ignore()
+                self.returnPressed.emit()
                 return
         super(RevsetEntry, self).keyPressEvent(event)