CSSG-Labs / PyNote

Text Editor Written in Python
GNU General Public License v3.0
3 stars 4 forks source link

Fixed missing newline #19

Closed mrHeavenli closed 2 years ago

mrHeavenli commented 2 years ago

It was a minor annoyance

PatrickBruso commented 2 years ago

Hi @mrHeavenli! Thanks for your PR. I am a bit new to some of this so I can't quite tell from looking at it why the newline is necessary? Can you give me a bit more of an explanation so I can understand it a bit better? Thanks!

mrHeavenli commented 2 years ago

Hi, apologies for not already giving an explanation. I think the program should add a newline at the end of the file because it makes it cleaner when I use the command cat on the files edited with PyNote. Using the command without the newline looks like this(content of file is "bar"):

carlos@waffle:~/PyNote$ cat foo 
barcarlos@waffle:~/PyNote$ 

But when there's a newline at the very end, the prompt gets placed on a new line. This is how it should look like, and the output I'd get from other editors:

carlos@waffle:~/PyNote$ cat foo 
bar
carlos@waffle:~/PyNote$ 

It's not massively important but it should be there. I hope I explained it in a way that sort of makes sense?

PatrickBruso commented 2 years ago

Thanks, that makes perfect sense! I've been testing it by opening the files in Notepad so I didn't even see what happens in the terminal. Approving the change now!