by Mofi » Fri Mar 11, 2011 1:21 pm
Well, all the macro code is to replace original behavior of EditDeleteNextWord in any situation as usual in insert mode (column mode turned off) plus the additional cursor down.
IfSel
Delete
EndIf
is for deleting current selection if something is selected as Ctrl+DEL does in this case.
IfCharIs 13
Delete
ExitMacro
EndIf
IfCharIs 10
Delete
ExitMacro
EndIf
is for deleting the line termination if Ctrl+DEL is pressed with caret at end of a line (CRLF, or only LF, or only CR).
IfCharIs 32
Find RegExp "[ ^t]+"
Replace ""
ExitMacro
EndIf
IfCharIs 9
Find RegExp "[ ^t]+"
Replace ""
ExitMacro
EndIf
is for deleting just all spaces/tabs up to next non whitespace character or line termination if the caret is positioned on a space or tab character.
And the last block
Find RegExp "[~^t^r^n ]+[ ^t]++"
Replace ""
Key DOWN ARROW
is what you actually want, delete from current position of the caret everything up to beginning of next word or end of line.
With that code blocks you see that even a simple command needs lots of code inside UltraEdit to work in every case. And that was surely not all. Well, the last 2 blocks could be replaced by a simplified version which would have the advantage to be independent of the regular expression engine.
InsertMode
ColumnModeOff
HexOff
IfSel
Delete
EndIf
IfCharIs 13
Delete
ExitMacro
EndIf
IfCharIs 10
Delete
ExitMacro
EndIf
StartSelect
Key Ctrl+RIGHT ARROW
EndSelect
Delete
Key DOWN ARROW
The Command list in the macro editor list all possible commands and selecting one command in this list results in displaying all possible parameters of this command in the Non-numeric parameters list. On help page opened with Help button all the commands with all possible parameters are also listed and additionally explained. As you can see, the command Key supports only a few caret (cursor) moving commands. It is simply by design not possible to run any command from within a macro by simulating pressing its assigned hotkey.