Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable commit: add MessageEntry.moveCursorToEnd() method

Changeset 6e0cb382a545

Parent 6f0165b7f202

by Steve Borho

Changes to one file · Browse files at 6e0cb382a545 Showing diff from parent 6f0165b7f202 Diff from another changeset...

 
133
134
135
 
 
 
 
 
 
 
 
 
136
137
138
 
374
375
376
377
378
379
380
381
382
383
384
 
385
386
387
 
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
 
383
384
385
 
 
 
 
 
 
 
 
386
387
388
389
@@ -133,6 +133,15 @@
  self.setCursorPosition(b, 0)   return b + len(outlines) + 1   + def moveCursorToEnd(self): + lines = self.lines() + if lines: + lines -= 1 + pos = self.lineLength(lines) + self.setCursorPosition(lines, pos) + self.ensureLineVisible(lines) + self.horizontalScrollBar().setSliderPosition(0) +   def keyPressEvent(self, event):   if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_E:   line, col = self.getCursorPosition() @@ -374,14 +383,7 @@
    def setMessage(self, msg):   self.msgte.setText(msg) - lines = self.msgte.lines() - if lines: - lines -= 1 - pos = self.msgte.lineLength(lines) - self.msgte.setCursorPosition(lines, pos) - self.msgte.ensureLineVisible(lines) - hs = self.msgte.horizontalScrollBar() - hs.setSliderPosition(0) + self.msgte.moveCursorToEnd()   self.msgte.setModified(False)     def canExit(self):