#18716
Shavok
Participant

This is the modified macro I’m working with that covers things quite nicely:

Redraw = false;

xPos = document.selection.GetActivePointX(eePosLogical);
yPos = document.selection.GetActivePointY(eePosLogical);

nLines = document.GetLines();
str = document.GetLine(nLines);
if(str.length != 0) {
	document.selection.EndOfDocument();
    document.selection.NewLine();
    document.selection.SelectLine();
    document.selection.Delete();
}

bExtendSelection = false;
document.selection.SetActivePoint(eePosLogical, xPos, yPos, bExtendSelection);

I wasn’t clear enough with the example I showed – it should be:

for i in range(1, 10, 1):
~~~~print i
~~~~<----where the line starts

This indentation is perfectly natural if you are going to have additional commands in Python. But on saving the expectation should be:

for i in range(1, 10, 1):
~~~~print i
<----where the line starts

Answering your question – yes, I do have line numbers enabled.