Changeset 099d368ba54e…
Parent 49a7fdad2994…
by
Changes to one file · Browse files at 099d368ba54e Showing diff from parent 49a7fdad2994 Diff from another changeset...
@@ -142,7 +142,6 @@ self._parent = 0
self._lostMode = None
self._lastSearch = u'', False
- self._lastScrollPosition = 0
self.actionDiffMode = QAction(qtlib.geticon('view-diff'),
_('View change as unified diff output'),
@@ -308,7 +307,6 @@ @pyqtSlot()
def clearDisplay(self):
self._filename = None
- self._lastScrollPosition = 0
self.restrictModes(False, False, False)
self.sci.setMarginWidth(1, 0)
self.clearMarkup()
@@ -327,10 +325,10 @@ status = hglib.fromunicode(status)
if self._filename == filename:
# Get the last visible line to restore it after reloading the editor
- self._lastScrollPosition = self.sci.firstVisibleLine()
+ lastScrollPosition = self.sci.firstVisibleLine()
else:
# Reset the scroll positions when the file is changed
- self._lastScrollPosition = 0
+ lastScrollPosition = 0
self._filename, self._status = filename, status
self.clearMarkup()
@@ -401,13 +399,6 @@ return
elif self._mode == AnnMode:
self.sci.setSource(filename, self._ctx.rev())
-
- # Recover the last scroll position
- # Make sure that _lastScrollPosition never exceeds the amount of
- # lines on the editor
- self._lastScrollPosition = min(self._lastScrollPosition, \
- self.sci.lines() - 1)
- self.sci.verticalScrollBar().setValue(self._lastScrollPosition)
else:
lexer = lexers.get_lexer(filename, fd.contents, self)
self.sci.setLexer(lexer)
@@ -416,12 +407,11 @@ self.sci.setText(fd.contents)
self.sci._updatemarginwidth()
- # Recover the last scroll position
- # Make sure that _lastScrollPosition never exceeds the amount of
- # lines on the editor
- self._lastScrollPosition = min(self._lastScrollPosition, \
- self.sci.lines() - 1)
- self.sci.verticalScrollBar().setValue(self._lastScrollPosition)
+ # Recover the last scroll position
+ # Make sure that lastScrollPosition never exceeds the amount of
+ # lines on the editor
+ lastScrollPosition = min(lastScrollPosition, self.sci.lines() - 1)
+ self.sci.verticalScrollBar().setValue(lastScrollPosition)
self.highlightText(*self._lastSearch)
uf = hglib.tounicode(self._filename)
|
Loading...