org.gjt.sp.jedit.indent
Class WhitespaceRule
java.lang.Object
org.gjt.sp.jedit.indent.WhitespaceRule
- All Implemented Interfaces:
- IndentRule
public class WhitespaceRule
- extends java.lang.Object
- implements IndentRule
Whitespace rule. This rule cancels all indent actions in the
following case:
- The previous line is all whitespace
- The current line is not empty
The result is that this rule won't allow the indentation to be
increased, only decreased (by rules triggered by unindentThisLine).
If the requirements above do not apply, this rule does nothing.
- Since:
- jEdit 4.3pre10
Method Summary |
void |
apply(JEditBuffer buffer,
int thisLineIndex,
int prevLineIndex,
int prevPrevLineIndex,
java.util.List<IndentAction> indentActions)
Apply the indent rule to this line, and return an indent action. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WhitespaceRule
public WhitespaceRule()
apply
public void apply(JEditBuffer buffer,
int thisLineIndex,
int prevLineIndex,
int prevPrevLineIndex,
java.util.List<IndentAction> indentActions)
- Description copied from interface:
IndentRule
- Apply the indent rule to this line, and return an indent action.
- Specified by:
apply
in interface IndentRule
- Parameters:
buffer
- the bufferthisLineIndex
- the line indexprevLineIndex
- the prior non empty line index
(or -1 if there is no prior non empty line)prevPrevLineIndex
- the prior non empty line index before the prevLineIndex
(or -1 if there is no prior non empty line)indentActions
- the indent actions list. The rule can add an action in it if
it is necessary