Skip to content

Commit

Permalink
fixed #591 - npe in folding
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdu committed Jul 23, 2010
1 parent 9433861 commit 976f412
Showing 1 changed file with 14 additions and 14 deletions.
Expand Up @@ -113,7 +113,7 @@ private static final class Tuple {

/**
* Filter for annotations.
*
*
* @since 3.2
*/
private static interface Filter {
Expand Down Expand Up @@ -184,7 +184,7 @@ public void elementChanged(final ElementChangedEvent e) {
* Projection position that will return two foldable regions: one folding
* away the region from after the '/**' to the beginning of the content, the
* other from after the first content line until after the comment.
*
*
* @since 3.1
*/
private static final class CommentPosition extends Position implements
Expand Down Expand Up @@ -250,7 +250,7 @@ public IRegion[] computeProjectionRegions(final IDocument document)
/**
* Finds the offset of the first identifier part within
* <code>content</code>. Returns 0 if none is found.
*
*
* @param content
* the content to search
* @return the first index of a unicode identifier part, or zero if none
Expand Down Expand Up @@ -316,7 +316,7 @@ public int computeCaptionOffset(final IDocument document) {
* Projection position that will return two foldable regions: one folding
* away the lines before the one containing the simple name of the erlang
* element, one folding away any lines after the caption.
*
*
* @since 3.1
*/
private static final class ErlangElementPosition extends Position implements
Expand Down Expand Up @@ -481,14 +481,14 @@ public boolean match(final ErlangProjectionAnnotation annotation) {
/* filters */
/**
* Member filter, matches nested members (but not top-level types).
*
*
* @since 3.2
*/
private final Filter fCollapseFunctionsFilter = new FunctionsFilter(false);

/**
* Comment filter, matches comments.
*
*
* @since 3.2
*/
private final Filter fCollapseCommentsFilter = new CommentsFilter(false);
Expand Down Expand Up @@ -542,7 +542,7 @@ public void projectionEnabled() {
// message.
projectionDisabled();

if (fEditor instanceof ErlangEditor) {
if (fEditor instanceof ErlangEditor && fModule!=null) {
initialize();
fElementListener = new ElementChangedListener();
ErlangCore.getModelManager().addElementChangedListener(
Expand Down Expand Up @@ -699,7 +699,7 @@ private void computeAdditions(final IErlElement element,
* than one range may be returned if the element has a leading comment which
* gets folded separately. If there are no foldable regions,
* <code>null</code> is returned.
*
*
* @param element
* the erlang element that can be folded
* @return the regions to be folded, or <code>null</code> if there are none
Expand Down Expand Up @@ -936,7 +936,7 @@ private void match(final List<ErlangProjectionAnnotation> deletions,
* If a match is found, the annotation gets removed from
* <code>annotations</code>.
* </p>
*
*
* @param tuple
* the tuple for which we want to find a match
* @param annotations
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public int compare(final Tuple o1, final Tuple o2) {

/*
* (non-Javadoc)
*
*
* @see
* org.erlide.ui.editors.erl.folding.IErlangFoldingStructureProviderExtension
* #collapseFunctions()
Expand All @@ -1014,7 +1014,7 @@ public void collapseFunctions() {

/*
* (non-Javadoc)
*
*
* @see
* org.erlide.ui.editors.erl.folding.IErlangFoldingStructureProviderExtension
* #collapseComments()
Expand All @@ -1025,7 +1025,7 @@ public void collapseComments() {

/*
* (non-Javadoc)
*
*
* @see
* org.erlide.ui.editors.erl.folding.IErlangFoldingStructureProviderExtension
* #expandAll()
Expand Down Expand Up @@ -1058,7 +1058,7 @@ public void expandElements(final IErlElement[] elements) {

/**
* Collapses all annotations matched by the passed filter.
*
*
* @param filter
* the filter to use to select which annotations to collapse
* @param expand
Expand Down Expand Up @@ -1102,7 +1102,7 @@ private void modifyFiltered(final Filter filter, final boolean expand) {

/*
* (non-Javadoc)
*
*
* @see
* org.erlide.core.erlang.IErlModelChangeListener#elementChanged(org.erlide
* .core.erlang.IErlElement)
Expand Down

0 comments on commit 976f412

Please sign in to comment.