Adaptable EOL?

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
nedbatchelder
Posts: 6
Joined: Wed May 03, 2006 1:48 am

Adaptable EOL?

Post by nedbatchelder »

I'd like Zeus to adapt the line endings to whatever is already in the file. Is this possible?

So if I opened a file with 0x0a line endings, and I entered some more lines, they'd end with 0x0a. If I opened a file with 0x0d0x0a line endings, and entered more lines, they'd end with Windows-style line endings.

Thanks.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Ned,
I'd like Zeus to adapt the line endings to whatever is already in the file. Is this possible?

I was sure Zeus already had this feature, but after some testing I found it was no longer working :(

I take a look at why it is no longer working.

Cheers Jussi
nedbatchelder
Posts: 6
Joined: Wed May 03, 2006 1:48 am

Is scripting this a possibility?

Post by nedbatchelder »

This issue is really starting to bother me. Is there a script I could use to set the line ending based on what is found in the file?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Is there a script I could use to set the line ending based on what is found in the file?
It is possible to control the state of the UNIX write option via a script. Below is some Lua code that shows how this is done:

Code: Select all

function key_macro()
	original = get_editor_option("UnixWrite")
	message_box(1, "UnixWrite " .. original)
	
	set_editor_option("UnixWrite", 1)
	value = get_editor_option("UnixWrite")
	message_box(1, "UnixWrite " .. value)
	
	value = set_editor_option("UnixWrite ", original)
	value = get_editor_option("UnixWrite")
	message_box(1, "UnixWrite " .. value)
end

key_macro() -- run the macro
Cheers Jussi
Post Reply