tmpVirtualMap[delta++] = i;
tmpVirtualMap[tmpMapLen++] = i; delta++;
	public boolean expandFoldAt(int line, boolean fully)	{		int initialFoldLevel = getFoldLevel(line);		int start = 0;		int end = lineCount - 1;		if(line != lineCount - 1			&& lineInfo[line].visible			&& !lineInfo[line + 1].visible			&& getFoldLevel(line + 1) > initialFoldLevel)		{			// this line is the start of a fold			start = line + 1;			for(int i = line + 1; i < lineCount; i++)			{				if(lineInfo[i].visible && getFoldLevel(i) <= initialFoldLevel)				{					end = i - 1;					break;				}			}		}		else		{			if(lineInfo[line].visible)			{				// the user probably pressed A+ENTER twice				return false;			}			boolean ok = false;			// scan backwards looking for the start			for(int i = line - 1; i >= 0; i--)			{				if(lineInfo[i].visible && getFoldLevel(i) < initialFoldLevel)				{					start = i + 1;					ok = true;					break;				}			}			if(!ok)			{				// no folds in buffer				return false;			}			for(int i = line + 1; i < lineCount; i++)			{				if(lineInfo[i].visible && getFoldLevel(i) < initialFoldLevel)				{					end = i - 1;					break;				}			}		}		int delta = 0;		int[] tmpVirtualMap = new int[end - start + 1];		// we need a different value of initialFoldLevel here!		initialFoldLevel = getFoldLevel(start);		//System.err.println("new initial fold level is " + initialFoldLevel);		for(int i = start; i <= end; i++)		{			LineInfo info = lineInfo[i];			if(info.visible)			{				// user will be confused if 'expand fold'				// hides lines			}			else if(fully && getFoldLevel(i) > initialFoldLevel)			{				// don't expand lines with higher fold				// levels			}			else			{				tmpVirtualMap[delta++] = i;				info.visible = true;			}		} 		System.err.println("expand from " + start + " to " + end			+ " with " + delta + " newly visible lines");		// I forgot to do this at first and it took me ages to		// figure out		int virtualLine = physicalToVirtual(start);		//System.err.println("virtual start is " + virtualLine		//	+ ", physical start is " + start);		// update virtual -> physical map		virtualLineCount += delta;		//System.err.println("virtual line count is " + virtualLineCount);		if(virtualLines.length <= virtualLineCount)		{			int[] virtualLinesN = new int[(virtualLineCount + 1) * 2];			System.arraycopy(virtualLines,0,				virtualLinesN,0,virtualLines.length);			virtualLines = virtualLinesN;		}		//System.err.println("copy from " + (virtualLine)		//	+ " to " + (virtualLine + delta));		System.arraycopy(virtualLines,virtualLine,virtualLines,			virtualLine + delta,virtualLines.length			- virtualLine - delta);		for(int j = 0; j < delta; j++)		{			//System.err.println((virtualLine + j) + " maps to " + tmpVirtualMap[j]);			virtualLines[virtualLine + j] = tmpVirtualMap[j];		}		fireFoldStructureChanged();		return true;	}