mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
New editor: when start is greater than end, delegate to upstream token maker, that will create an empty token. Fixes #3293
This commit is contained in:
parent
cdae13c3cc
commit
0a6841d9b0
@ -32,8 +32,6 @@ package processing.app.syntax;
|
||||
|
||||
import org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Controls the syntax highlighting of {@link SketchTextArea} based on the {@link PdeKeywords}
|
||||
*
|
||||
@ -51,6 +49,11 @@ public class SketchTokenMaker extends CPlusPlusTokenMaker {
|
||||
|
||||
@Override
|
||||
public void addToken(char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink) {
|
||||
if (start > end) {
|
||||
super.addToken(array, start, end, tokenType, startOffset, hyperlink);
|
||||
return;
|
||||
}
|
||||
|
||||
// This assumes all of your extra tokens would normally be scanned as IDENTIFIER.
|
||||
int newType = pdeKeywords.getTokenType(array, start, end);
|
||||
if (newType > -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user