Revision: 5630
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5630&view=rev
Author: manningr
Date: 2010-05-30 17:26:11 +0000 (Sun, 30 May 2010)
Log Message:
-----------
Merged from trunk revision 5627 (Bug-Fix : RSyntax: When code reformatting was used on Windows, carriage return chars (\r) where inserted in the editor. These chars made keyboard arrow keys fail: If you stepped over an \r the key hit did nothing.)
Revision Links:
--------------
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5627&view=rev
Modified Paths:
--------------
branches/squirrel-sql_3_1_1/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java
Modified: branches/squirrel-sql_3_1_1/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java
===================================================================
--- branches/squirrel-sql_3_1_1/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java 2010-05-30 17:19:24 UTC (rev 5629)
+++ branches/squirrel-sql_3_1_1/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java 2010-05-30 17:26:11 UTC (rev 5630)
@@ -145,6 +145,7 @@
*/
public void setText(String text)
{
+ text = removeCarriageReturn(text);
setText(text, true);
triggerParser();
}
@@ -161,6 +162,7 @@
*/
public void setText(String text, boolean select)
{
+ text = removeCarriageReturn(text);
_textArea.setText(text);
if (select)
{
@@ -178,6 +180,7 @@
*/
public void appendText(String sqlScript)
{
+ sqlScript = removeCarriageReturn(sqlScript);
appendText(sqlScript, false);
}
@@ -193,6 +196,7 @@
*/
public void appendText(String sqlScript, boolean select)
{
+ sqlScript = removeCarriageReturn(sqlScript);
Document doc = _textArea.getDocument();
try
@@ -282,12 +286,29 @@
*/
public void replaceSelection(String sqlScript)
{
+ sqlScript = removeCarriageReturn(sqlScript);
_textArea.replaceSelection(sqlScript);
triggerParser();
}
+ /**
+ * RSyntax does not like CRs, even on Windows.
+ * If you insert ones you find that arrow keys do not work correctly:
+ * When steping over a CR it looks like the arrow key does nothing.
+ *
+ * E.G.: Code reformating comes with CRs in line ends on Windows
+ */
+ private String removeCarriageReturn(String text)
+ {
+ if(null == text)
+ {
+ return null;
+ }
+ return text.replaceAll("\r","");
+ }
+
private void triggerParser()
{
IParserEventsProcessor parserEventsProcessor = _propertiesWrapper.getParserEventsProcessor(getIdentifier(), _session);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|