.getRegionAtCharacterOffset(formattedLineStart);
regionStart += firstTokenInLine.getStart();
}
int scriptRegionLength = 0;
if (firstTokenInLine instanceof IPhpScriptRegion) {
IPhpScriptRegion scriptRegion = (IPhpScriptRegion) firstTokenInLine;
if (scriptRegion.getStart() + scriptRegion.getLength() < formattedLineStart
- regionStart) {
return;
}
scriptRegionLength = scriptRegion.getStart();
firstTokenInLine = scriptRegion.getPhpToken(formattedLineStart
- regionStart);
if (firstTokenInLine != null
&& firstTokenInLine.getStart()
+ sdRegion.getStartOffset() < orginalLineStart
&& firstTokenInLine.getType() == PHPRegionTypes.WHITESPACE) {
firstTokenInLine = scriptRegion
.getPhpToken(formattedLineStart - regionStart
+ firstTokenInLine.getLength());
}
if (scriptRegion.getStart() + scriptRegion.getLength() >= formattedTextEnd
- regionStart - 1) {
lastTokenInLine = scriptRegion.getPhpToken(formattedTextEnd
- regionStart - 1);
if (lastTokenInLine != null
&& lastTokenInLine.getEnd()
+ sdRegion.getStartOffset() > orginalLineStart
+ originalLineLength
&& lastTokenInLine.getType() == PHPRegionTypes.WHITESPACE) {
lastTokenInLine = scriptRegion
.getPhpToken(formattedTextEnd - regionStart - 1
- lastTokenInLine.getLength());
}
}
}