|
From: <caw...@us...> - 2007-06-21 18:55:18
|
Revision: 2664
http://svn.sourceforge.net/rubyeclipse/?rev=2664&view=rev
Author: cawilliams
Date: 2007-06-21 11:55:17 -0700 (Thu, 21 Jun 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java 2007-06-21 18:55:10 UTC (rev 2663)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java 2007-06-21 18:55:17 UTC (rev 2664)
@@ -99,7 +99,11 @@
IRegion previousLineRegion = d.getLineInformation(line - 1);
String previousIndent= indenter.computeIndentation(previousLineRegion.getOffset()).toString();
// FIXME This all assumes spaces!
- String unindented = previousIndent.substring(0, previousIndent.length() - CodeFormatterUtil.createIndentString(1, fProject).length());
+ int length = previousIndent.length() - CodeFormatterUtil.createIndentString(1, fProject).length();
+ String unindented = previousIndent;
+ if (length > 0) {
+ unindented = previousIndent.substring(0, length);
+ }
if (!unindented.equals(indent.toString())) {
d.replace(start, c.offset - start, unindented + trimmed);
int shift = previousIndent.length() - unindented.length();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|