New Line at EOF on Save

New Line at EOF on Save

2
NewbieNewbie
2

    Jul 29, 2014#1

    Hi

    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?

    Thanks!

    6,603548
    Grand MasterGrand Master
    6,603548

      Jul 29, 2014#2

      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

      ToggleBookmark
      InsertMode
      ColumnModeOff
      Bottom
      IfColNumGt 1
      InsertLine
      IfColNumGt 1
      DeleteToStartofLine
      EndIf
      EndIf
      GotoBookMark -1
      ToggleBookmark
      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 an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jul 29, 2014#3

        Thank you! Appreciate the help...