[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit:[21620] jEdit/trunk/org/gjt/sp/jedit/syntax/ DisplayTokenHandler
From:       k_satoda () users ! sourceforge ! net
Date:       2012-04-30 20:24:39
Message-ID: E1SOx9D-0002Y6-OV () sfp-svn-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

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.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic