How to write a macro to Change Auto-Indent Behavior?
Submitted by Wednesday, 15 September, 2004 - 21:45
on
PROBLEM:
There is one frustrating aspect of auto-indentation
with jEdit that I would like to change with a macro.
Here is some sample text to demonstrate what I am
talking about. ...
If you put the cursor before "1Watermellon" and then press ENTER, jEdit will auto-indent to make it the same indentation level as "4Potato".
This is contrary to what I'd expect because I'm trying to insert some blank non-indented lines in between 'potato' and 'watermellon'. I am *not* trying to make watermellon indented beneath potato.
The problem seems to be that jEdit does auto-indentation based on the previous *non-blank* line, instead of just the previous line.
QUESTION: How can I change this behavior with a macro or with other means, short of recompiling jEdit.
1Potato 2Potato 3Potato 4Potato 1Watermellon 2Watermellon 3Watermellon 4Watermellon
If you put the cursor before "1Watermellon" and then press ENTER, jEdit will auto-indent to make it the same indentation level as "4Potato".
This is contrary to what I'd expect because I'm trying to insert some blank non-indented lines in between 'potato' and 'watermellon'. I am *not* trying to make watermellon indented beneath potato.
The problem seems to be that jEdit does auto-indentation based on the previous *non-blank* line, instead of just the previous line.
QUESTION: How can I change this behavior with a macro or with other means, short of recompiling jEdit.