User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with writing and playing macros
3 posts Page 1 of 1

Is there an option to ensure there is a new line at the end of the file when saving? Similar to trimming spaces. If not, could it be put forward as a suggestion?

There is no configuration setting for appending a line termination on save at end of file if a file opened in text edit mode does not have one.

A macro executed on every file save could be used for this task if

  1. only text files are edited in UltraEdit and editing of binary files in hex edit mode is never done;
  2. bookmarks are not used as the macro below uses a bookmark to remember and restore current position of caret in the file.
The code for an UltraEdit macro for example with name CheckNewLineEOF stored in a macro file for example with name OnLoadSave.mac is:

Code: Select all
IfColNumGt 1
IfColNumGt 1
GotoBookMark -1

The macro file and the name of the macro must be specified in dialog opened via Macro - Set Macro for File Load/Save.

See top of this page with the email us directly mailto link regarding feature requests.
Best regards from Austria
Thank you! Appreciate the help...
3 posts Page 1 of 1