From: Dustin F. <df...@hu...> - 2013-03-13 13:55:45
|
Hey, I'm trying to write a small macro script that moves the cursor to the end of the current line and then starts a new line. Because I want the new line to be automatically indented, cursor.insertLine()/insertText() does not work. Now I tried the following: %SCRIPT cursor.movePosition(1, cursorEnums.EndOfLine); editor.write(editor.document().lineEndingString()); But instead of first moving the cursor, the cursor gets moved *after* inserting the newline. I'm a bit confused, so can somebody please explain why this isn't working as expected? And is there some other way of achieving the expected behavior? Thanks, Dustin |