Changeset 403

Show
Ignore:
Timestamp:
09/27/08 13:45:19 (3 months ago)
Author:
tjas..@bitfauna.com
Message:

Tim Jasko
-Made the indenter indent the current line if parens aren't balanced

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/autoedits/LispIndentOnTab.java

    r302 r403  
    77import org.eclipse.jface.text.IAutoEditStrategy; 
    88import org.eclipse.jface.text.IDocument; 
     9import org.eclipse.jface.text.ITextSelection; 
    910 
    1011public class LispIndentOnTab implements IAutoEditStrategy { 
    11  
     12         
    1213        private void cmdEnd(DocumentCommand c, int offset){ 
    1314                c.shiftsCaret = false; 
     
    3839                                                        IndentAction.doIndent(topLvlRange[0], topLvlRange[1], d,c.offset); 
    3940                                                cmdEnd(c,offsets[2]); 
    40                                         }                                        
     41                                        } else { 
     42                                                // Just indent the line we're on if parens aren't balancing yet 
     43                                                int newOffset[] = IndentAction.doIndent(c.offset, 0, d, c.offset); 
     44                                                cmdEnd(c, newOffset[2]); 
     45                                        } 
    4146                                } 
    4247                        }