From c085118aac3518d112dcb4abcbd68a7ec92b592c Mon Sep 17 00:00:00 2001 From: utente Date: Tue, 25 Jun 2013 12:13:36 +0200 Subject: [PATCH] #1681 Syntax highlighting with / bug low file :PdeKeywords.java function:markTokensImpl(...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explanation: During the scanning of the line to check if the Token belongs to Processing Syntax ,When my current character is "/" , we check if the next character(if any) is "*" or "/" , and we do then an increment of the scanning index , so in this case , and if the next character in an alphabet we don’t have a problem , but if it is " " (a space) , the loss of this character will make the lastKeyword scan index incorrect , so we get this problem of highlighting . To solve it, we check before incrementing the index, if the next character is " ", so we don’t increment. Result and Test: The example mouseX/ mouseY highlight the two PDE keyword and the fix http://processing.org/bugs/bugzilla/609.html //* println("1"); /*/ println("2"); //*/ still working .So i think this fix works --- app/src/processing/app/syntax/PdeKeywords.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 9b5ea6838..e9b29f1ff 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -137,7 +137,8 @@ public class PdeKeywords extends TokenMarker { lastOffset = lastKeyword = mlength; break loop; } - i++; // http://processing.org/bugs/bugzilla/609.html [jdf] + if(array[i1]!=' ') + i++; // http://processing.org/bugs/bugzilla/609.html [jdf] } break; default: