Automatically ending a file with a line feed?

Help with writing and playing macros

Automatically ending a file with a line feed?

Postby JohnJSal » Wed Jun 11, 2008 10:27 pm

Hi everyone. Is there a setting somewhere that automatically inserts an LF on the last line of a file when you save it? I can't seem to find anything like that.

Thanks,
John
User avatar
JohnJSal
Advanced User
Advanced User
 
Posts: 60
Joined: Sat Mar 05, 2005 12:00 am

Re: Automatically ending a file with a line feed?

Postby jorrasdk » Thu Jun 12, 2008 1:53 am

Not as far as I know, but how about setting a macro to do the job in Macro - Set macro for file load/save ?
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Automatically ending a file with a line feed?

Postby Mofi » Thu Jun 12, 2008 2:34 am

And here is the macro code which could be executed on every file save. But it works only if you normally don't use bookmarks. The bookmark is used to set the cursor back to current position on file save after checking the line termination of the last line.

ToggleBookmark
Bottom
IfColNumGt 1
InsertLine
IfColNumGt 1
DeleteToStartofLine
EndIf
EndIf
GotoBookMark -1
ToggleBookmark
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros