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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 12 Oct 2014 16:17:30 +0200
branch
5_5_x
changeset 3864
bac91da5d76a
parent 3862
498ea247eeef
child 3866
e3c747b01f60

Corrected the annotations scrollbar fix because it caused seg faults for short files.
(grafted from 472eb955ff9c2f7af1802ee1d4b47f13ba226822)

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
@@ -402,7 +402,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
@@ -215,6 +215,7 @@
         self.acAPI = False
         
         self.__lastEditPosition = None
+        self.__annotationLines = 0
         
         # list of clones
         self.__clones = []
@@ -1947,7 +1948,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