|
From: <caw...@us...> - 2007-07-31 19:01:12
|
Revision: 2904
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2904&view=rev
Author: cawilliams
Date: 2007-07-31 12:01:11 -0700 (Tue, 31 Jul 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-07-31 17:29:22 UTC (rev 2903)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java 2007-07-31 19:01:11 UTC (rev 2904)
@@ -103,14 +103,14 @@
String unindented = "";
if (length > 0) {
unindented = previousIndent.substring(0, length);
- }
- if (!unindented.equals(indent.toString())) {
- d.replace(start, c.offset - start, unindented + trimmed);
+ } // FIXME Deindenting 'end' of case that has indented 'when's comes out incorrectly
+ if (length < indent.length()) { // if calculated indent length is less than indent we currently have queued up...
+ d.replace(start, c.offset - start, unindented + trimmed); // fix indent of this line
int shift = previousIndent.length() - unindented.length();
- c.offset = c.offset - shift;
+ c.offset = c.offset - shift; // change where we're adding the newline
if (trimmed.equals(BLOCK_CLOSER)) // if we're closing the block, remove an indent unit
buf.delete(buf.length() - shift, buf.length());
- }
+ }
}
// If we're hitting return at the end of the line of a new block, add indent
if (atStartOfBlock(trimmed)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|