From: <k_s...@us...> - 2008-08-19 15:21:40
|
Revision: 13371 http://jedit.svn.sourceforge.net/jedit/?rev=13371&view=rev Author: k_satoda Date: 2008-08-19 15:21:37 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Fixed RuntimeException "Invalid screen line cout" which happened when scrolling in a compound edit. (SF.net patch #1990960) Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt jEdit/trunk/org/gjt/sp/jedit/textarea/DisplayManager.java jEdit/trunk/org/gjt/sp/jedit/textarea/FirstLine.java jEdit/trunk/org/gjt/sp/jedit/textarea/ScrollLineCount.java Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2008-08-19 06:00:00 UTC (rev 13370) +++ jEdit/trunk/doc/CHANGES.txt 2008-08-19 15:21:37 UTC (rev 13371) @@ -8,6 +8,9 @@ - Closed buffers were often kept in memory. (Kazutoshi Satoda) +- Error "Invalid screen line count" was shown when scrolling in a + compound edit. (SF.net patch #1990960 - Kazutoshi Satoda) + }}} {{{ Miscellaneous - Moved buffer list sorting options from General to View Option Pane Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/DisplayManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/DisplayManager.java 2008-08-19 06:00:00 UTC (rev 13370) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/DisplayManager.java 2008-08-19 15:21:37 UTC (rev 13371) @@ -188,9 +188,7 @@ */ public final int getScreenLineCount(int line) { - if(!screenLineMgr.isScreenLineCountValid(line)) - throw new RuntimeException("Invalid screen line count: " + line); - + updateScreenLineCount(line); return screenLineMgr.getScreenLineCount(line); } //}}} @@ -756,7 +754,6 @@ if(!isLineVisible(i)) { // important: not screenLineMgr.getScreenLineCount() - updateScreenLineCount(i); int screenLines = getScreenLineCount(i); if(firstLine.physicalLine >= i) { @@ -786,7 +783,7 @@ i = getNextVisibleLine(i); while(i != -1 && i <= end) { - int screenLines = screenLineMgr.getScreenLineCount(i); + int screenLines = getScreenLineCount(i); if(i < firstLine.physicalLine) { firstLine.scrollLine -= screenLines; @@ -815,8 +812,7 @@ { firstLine.physicalLine = getPrevVisibleLine( firstLine.physicalLine); - firstLine.scrollLine -= - screenLineMgr.getScreenLineCount( + firstLine.scrollLine -= getScreenLineCount( firstLine.physicalLine); } firstLine.callChanged = true; Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/FirstLine.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/FirstLine.java 2008-08-19 06:00:00 UTC (rev 13370) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/FirstLine.java 2008-08-19 15:21:37 UTC (rev 13371) @@ -114,10 +114,6 @@ if(i >= oldPhysicalLine) break; - int before = scrollLine; - displayManager.updateScreenLineCount(i); - if(before != scrollLine) - throw new RuntimeException(this + " nudged"); scrollLine += displayManager.getScreenLineCount(i); int nextLine = displayManager.getNextVisibleLine(i); @@ -129,7 +125,6 @@ physicalLine = i; - displayManager.updateScreenLineCount(i); int screenLines = displayManager.getScreenLineCount(physicalLine); if(skew >= screenLines) skew = screenLines - 1; Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/ScrollLineCount.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/ScrollLineCount.java 2008-08-19 06:00:00 UTC (rev 13370) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/ScrollLineCount.java 2008-08-19 15:21:37 UTC (rev 13371) @@ -51,10 +51,6 @@ int scrollLine = 0; while(physicalLine != -1) { - int before = scrollLine; - displayManager.updateScreenLineCount(physicalLine); - if(before != scrollLine) - throw new RuntimeException(this + " nudged"); scrollLine += displayManager .getScreenLineCount(physicalLine); physicalLine = displayManager This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |