From: <k_s...@us...> - 2012-04-30 20:24:45
|
Revision: 21620 http://jedit.svn.sourceforge.net/jedit/?rev=21620&view=rev Author: k_satoda Date: 2012-04-30 20:24:39 +0000 (Mon, 30 Apr 2012) Log Message: ----------- Extended the workaround for unacceptable break inside quote for the case where the quote mark is enclosed by something like a parenthesis. (SF.net bug #3502384) Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java 2012-04-30 18:05:30 UTC (rev 21619) +++ jEdit/trunk/org/gjt/sp/jedit/syntax/DisplayTokenHandler.java 2012-04-30 20:24:39 UTC (rev 21620) @@ -638,17 +638,39 @@ && !Character.isWhitespace(next)) { int beforeQuote = baseBreak - 2; - return beforeQuote < text.getBeginIndex() - || Character.isWhitespace(charAt(text, - beforeQuote)); + int beginIndex = text.getBeginIndex(); + while (beforeQuote >= beginIndex) + { + char c = charAt(text, beforeQuote); + if (Character.isWhitespace(c)) + return true; + if (Character.isLetterOrDigit(c)) + return false; + // Look farther in case where the + // opening quote is enclosed by + // something like a opening parenthesis. + --beforeQuote; + } + return true; } else if (!Character.isWhitespace(prev) && "“„‘‚«‹".indexOf(next) >= 0) { int afterQuote = baseBreak + 1; - return afterQuote >= text.getEndIndex() - || Character.isWhitespace(charAt(text, - afterQuote)); + int endIndex = text.getEndIndex(); + while (afterQuote < endIndex) + { + char c = charAt(text, afterQuote); + if (Character.isWhitespace(c)) + return true; + if (Character.isLetterOrDigit(c)) + return false; + // Look farther in case where the + // closing quote is enclosed by + // something like a closing parenthesis. + ++afterQuote; + } + return true; } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |