|
From: <caw...@us...> - 2007-07-24 14:50:34
|
Revision: 2826
http://svn.sourceforge.net/rubyeclipse/?rev=2826&view=rev
Author: cawilliams
Date: 2007-07-24 07:50:32 -0700 (Tue, 24 Jul 2007)
Log Message:
-----------
part of fix for #5259 - RDT case statement breaks indentation. Normal editing behaves more like user expects now.
Still have to make sure code formatter actually uses same indentation rules...
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-24 14:16:50 UTC (rev 2825)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyAutoIndentStrategy.java 2007-07-24 14:50:32 UTC (rev 2826)
@@ -141,8 +141,8 @@
private boolean shouldDeIndent(String trimmed) {
if (trimmed == null || trimmed.length() == 0) return false;
- return trimmed.equals("rescue") || trimmed.equals("else") || trimmed.equals("ensure") || trimmed.equals(BLOCK_CLOSER)
- || trimmed.startsWith("when ") || trimmed.startsWith("elsif ");
+ return trimmed.equals("rescue") || trimmed.equals("else") || trimmed.equals("ensure")
+ || trimmed.equals(BLOCK_CLOSER) || trimmed.startsWith("elsif ");
}
private boolean unclosedBlock(IDocument d, String trimmed, int offset) {
@@ -177,7 +177,7 @@
private boolean atStartOfBlock(String line) {
return line.startsWith("class ") || line.startsWith("if ") || line.startsWith("module ")
- || line.startsWith("unless ") || line.startsWith("def ") || line.equals("begin")
+ || line.startsWith("unless ") || line.startsWith("def ") || line.equals("begin") || line.startsWith("case ")
|| openBlockPattern.matcher(line).matches();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|