I erroneously opened a binary file in ted and it behaved strangely (misplaced cursor and line numbers), and after a certain line (300 or something) just hanged. I have yet to reproduce this behavior on multiple files, but I will post updates on this bug soon.
Actually ted can be closed just with ctrl+c, even if unsaved changes to a file have been made.
Isn't a little bit too easy to erroneously quit in this way? Should ted prompt the user for a confirm message (ex: Are you sure to quit?)? Or maybe introduce the exit/quit config dialog (like vim)?
Hello, I was experimenting a little bit with config dialogs and I made the following major changes:
Split into substrings the command and pass them as argument of the respective function. (This eliminates the need for multiple call to prompt)
Add hints when writing commands in config dialogs (still at an early stage, but functioning). (This was made as a substitution for prompts custom messages)
Return a bool from detect_extension which indicates if a syntax was found or not
You can see all the changes in this branch: https://github.com/bynect/Teditor/tree/major.
Since this are somewhat bigger changes than the others, I was hoping to hear your opinions before creating a pr.
When there is a carriage return character (0x0D), it removes the line number of the line it's on. I think CR (carriage return) needs to be interpreted as a new line (0x0a, '\n', line feed).