mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03: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:
@ -32,8 +32,6 @@ package processing.app.syntax;
|
|||||||
|
|
||||||
import org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker;
|
import org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls the syntax highlighting of {@link SketchTextArea} based on the {@link PdeKeywords}
|
* Controls the syntax highlighting of {@link SketchTextArea} based on the {@link PdeKeywords}
|
||||||
*
|
*
|
||||||
@ -51,6 +49,11 @@ public class SketchTokenMaker extends CPlusPlusTokenMaker {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addToken(char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink) {
|
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.
|
// This assumes all of your extra tokens would normally be scanned as IDENTIFIER.
|
||||||
int newType = pdeKeywords.getTokenType(array, start, end);
|
int newType = pdeKeywords.getTokenType(array, start, end);
|
||||||
if (newType > -1) {
|
if (newType > -1) {
|
||||||
|
Reference in New Issue
Block a user