PB-Editor should insert an empty line at the end of the code

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

PB-Editor should insert an empty line at the end of the code

Post by Sicro »

The PB editor should insert an empty line at the end of the code.

Many Linux programs require this on text files and otherwise do not work correctly.
For example:

Code: Select all

$ wc -l file.pb
returns the value "0" as the number of lines even though a line of code exists.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: PB-Editor should insert an empty line at the end of the

Post by #NULL »

My Linuy PB-IDE even removes one last linebreak every time i save the file and reopen the Editor. I don't want an editor to do that either way. Might be Scintilla or the Prefs handling, i don't know.
But for wc: its counts newline characters, not lines. Otherwise it would get ambiguous. Does an empty file has one empty line or zero lines?
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

Re: PB-Editor should insert an empty line at the end of the

Post by Oma »

I agree with you.
If you edit a PureBasic source code file with another program, it is very likely that the last line will be missing when you reload it.
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Post Reply