Corrected the annotations scrollbar fix because it caused seg faults for short files.

Sun, 12 Oct 2014 16:17:30 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 12 Oct 2014 16:17:30 +0200
changeset 3863
472eb955ff9c
parent 3861
9489d1c4639d
child 3865
425bce508cf4

Corrected the annotations scrollbar fix because it caused seg faults for short files.

Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sat Oct 11 19:08:00 2014 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Oct 12 16:17:30 2014 +0200
@@ -400,7 +400,7 @@
                     html += self.tr('Deleted {0}<br />\n')\
                         .format(Utilities.html_encode(f))
             
-            html += '</p>{0}<br/>\n'.format(80 * "=")
+            html += '</p>{0}<br/>\n'.format(60 * "=")
         
         self.contents.setHtml(html)
         tc = self.contents.textCursor()
--- a/QScintilla/Editor.py	Sat Oct 11 19:08:00 2014 +0200
+++ b/QScintilla/Editor.py	Sun Oct 12 16:17:30 2014 +0200
@@ -216,6 +216,7 @@
         self.acAPI = False
         
         self.__lastEditPosition = None
+        self.__annotationLines = 0
         
         # list of clones
         self.__clones = []
@@ -1948,7 +1949,9 @@
             vsb = self.verticalScrollBar()
             vsbMax = vsb.maximum()
             vsbValue = vsb.value()
-            vsb.setMaximum(vsbMax + annotationLinesAdded)
+            self.__annotationLines += annotationLinesAdded
+            vsb.setMaximum(max(self.lines() + self.__annotationLines - 
+                               self.linesOnScreen(), 0))
             if vsbValue == vsbMax:
                 vsb.setValue(vsb.maximum())
         

eric ide

mercurial