mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Apply different themes to GroovyPad RSTA Code and Console
This commit is contained in:
parent
a851b13a91
commit
e5af729901
@ -13,7 +13,7 @@ public class FormatExpressionTokenMaker extends TokenMakerBase {
|
|||||||
private static final GroovyExpressionTokenMaker groovyTokenMaker = new GroovyExpressionTokenMaker();
|
private static final GroovyExpressionTokenMaker groovyTokenMaker = new GroovyExpressionTokenMaker();
|
||||||
|
|
||||||
public static final int LANGUAGE_LITERAL = 0;
|
public static final int LANGUAGE_LITERAL = 0;
|
||||||
public static final int LANGUAGE_GROOVY = 10;
|
public static final int LANGUAGE_GROOVY = 1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Token getTokenList(Segment segment, int initialTokenType, int startOffset) {
|
public Token getTokenList(Segment segment, int initialTokenType, int startOffset) {
|
||||||
@ -70,9 +70,7 @@ public class FormatExpressionTokenMaker extends TokenMakerBase {
|
|||||||
Segment groovySegment = new Segment(segment.array, segment.getBeginIndex() + start, end - start);
|
Segment groovySegment = new Segment(segment.array, segment.getBeginIndex() + start, end - start);
|
||||||
addToken(groovyTokenMaker.getTokenList(groovySegment, initialTokenType, startOffset + start));
|
addToken(groovyTokenMaker.getTokenList(groovySegment, initialTokenType, startOffset + start));
|
||||||
}
|
}
|
||||||
if (firstToken == null) {
|
addLevelToken(level);
|
||||||
addToken(segment, segment.getBeginIndex() + start, segment.getBeginIndex() + end - 1, initialTokenType, startOffset + start);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (start != end) {
|
if (start != end) {
|
||||||
@ -85,8 +83,13 @@ public class FormatExpressionTokenMaker extends TokenMakerBase {
|
|||||||
return firstToken;
|
return firstToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void addLevelToken(int level) {
|
||||||
|
addNullToken();
|
||||||
|
currentToken.setType(-level);
|
||||||
|
}
|
||||||
|
|
||||||
protected int getInitialLevel(Segment segment, int initialTokenType, int startOffset) {
|
protected int getInitialLevel(Segment segment, int initialTokenType, int startOffset) {
|
||||||
return initialTokenType == TokenTypes.NULL ? 0 : 1;
|
return initialTokenType < 0 ? -initialTokenType : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addToken(Token token) {
|
protected void addToken(Token token) {
|
||||||
@ -113,6 +116,11 @@ public class FormatExpressionTokenMaker extends TokenMakerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getClosestStandardTokenTypeForInternalType(int type) {
|
||||||
|
return type < 0 ? TokenTypes.NULL : groovyTokenMaker.getClosestStandardTokenTypeForInternalType(type);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getCurlyBracesDenoteCodeBlocks(int languageIndex) {
|
public boolean getCurlyBracesDenoteCodeBlocks(int languageIndex) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user