From: <sh...@us...> - 2007-10-09 07:08:13
|
Revision: 10859 http://jedit.svn.sourceforge.net/jedit/?rev=10859&view=rev Author: shlomy Date: 2007-10-09 00:08:12 -0700 (Tue, 09 Oct 2007) Log Message: ----------- Allow the parser to override the fold handler. This was done mainly for CtagsSideKick, for which the SideKick fold handler returns inconsistent fold levels. Modified Paths: -------------- plugins/SideKick/trunk/sidekick/SideKickFoldHandler.java plugins/SideKick/trunk/sidekick/SideKickParsedData.java Modified: plugins/SideKick/trunk/sidekick/SideKickFoldHandler.java =================================================================== --- plugins/SideKick/trunk/sidekick/SideKickFoldHandler.java 2007-10-09 04:12:36 UTC (rev 10858) +++ plugins/SideKick/trunk/sidekick/SideKickFoldHandler.java 2007-10-09 07:08:12 UTC (rev 10859) @@ -53,6 +53,9 @@ SideKickPlugin.PARSED_DATA_PROPERTY); if(data == null) return 0; + FoldHandler override = data.getFoldHandler(); + if (override != null) + return override.getFoldLevel(buffer, lineIndex, seg); int lineStartOffset = buffer.getLineStartOffset(lineIndex); TreePath path = data.getTreePathForPosition(lineStartOffset); if(path == null) Modified: plugins/SideKick/trunk/sidekick/SideKickParsedData.java =================================================================== --- plugins/SideKick/trunk/sidekick/SideKickParsedData.java 2007-10-09 04:12:36 UTC (rev 10858) +++ plugins/SideKick/trunk/sidekick/SideKickParsedData.java 2007-10-09 07:08:12 UTC (rev 10859) @@ -26,6 +26,7 @@ import javax.swing.tree.*; import java.util.*; import org.gjt.sp.jedit.View; +import org.gjt.sp.jedit.buffer.FoldHandler; import org.gjt.sp.util.Log; import javax.swing.text.Position; @@ -162,6 +163,11 @@ return null; } + protected FoldHandler getFoldHandler() + { + return null; + } + private static boolean assetContains(IAsset asset, int offset) { return offset >= asset.getStart().getOffset() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |