QScintilla/Editor.py

changeset 1897
4c89af5a756f
parent 1831
2dd263d670ca
child 1928
adde55ed4ce5
--- a/QScintilla/Editor.py	Tue Jun 12 19:01:14 2012 +0200
+++ b/QScintilla/Editor.py	Wed Jun 13 19:27:35 2012 +0200
@@ -2697,9 +2697,7 @@
         
         @param line line number to make visible
         """
-        topLine = self.firstVisibleLine()
-        linesToScroll = line - topLine
-        self.scrollVertical(linesToScroll)
+        self.setFirstVisibleLine(line - 1)
         
     def __marginClicked(self, margin, line, modifiers):
         """
@@ -3335,15 +3333,20 @@
             else:
                 self.__indentLine(True)
         
-    def gotoLine(self, line, pos=1):
+    def gotoLine(self, line, pos=1, firstVisible=False):
         """
         Public slot to jump to the beginning of a line.
         
         @param line line number to go to (integer)
         @keyparam pos position in line to go to (integer)
+        @keyparam firstVisible flag indicating to make the line the first
+            visible line (boolean)
         """
         self.setCursorPosition(line - 1, pos - 1)
-        self.ensureVisible(line)
+        if firstVisible:
+            self.ensureVisibleTop(line)
+        else:
+            self.ensureVisible(line)
     
     def __textChanged(self):
         """

eric ide

mercurial