Revision: 5627
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5627&view=rev
Author: gerdwagner
Date: 2010-05-27 04:09:30 +0000 (Thu, 27 May 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/sql12/doc/changes.txt
trunk/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java
Modified: trunk/sql12/doc/changes.txt
===================================================================
--- trunk/sql12/doc/changes.txt 2010-05-20 21:16:01 UTC (rev 5626)
+++ trunk/sql12/doc/changes.txt 2010-05-27 04:09:30 UTC (rev 5627)
@@ -6,6 +6,10 @@
Bug-fixes:
+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.
+
+
2991971: RSyntax text editor ignores font settings
2992443: Cannot use RSyntax or Netbeans editors
Modified: trunk/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java
===================================================================
--- trunk/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java 2010-05-20 21:16:01 UTC (rev 5626)
+++ trunk/sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryPanel.java 2010-05-27 04:09:30 UTC (rev 5627)
@@ -145,11 +145,12 @@
*/
public void setText(String text)
{
+ text = removeCarriageReturn(text);
setText(text, true);
triggerParser();
}
- /**
+ /**
* Replace the contents of the SQL entry area with the passed SQL script and
* specify whether to select it.
*
@@ -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,32 @@
*/
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.
|