Closed SamuraiCrow closed 3 weeks ago
Does this happen with a specific project ? Do you have any public example I can try ?
IIRC we now default to the Unix style unless instructed otherwise via .editorconfig. Try adding one to the root folder with the following lines:
# top-most EditorConfig file
root = true
# Windows-style newlines
[*]
end_of_line = crlf
#insert_final_newline = true
#indent_style = tab
#indent_size = 4
Uncomment the remaining lines as you wish
Maybe se should detect the CR style instead, if no editorconfig is present?
https://github.com/hitchhikr/protrekkr is a Windows repo with a Haiku makefile and uses conditional compilation. The line endings are cr/lf and when I open a file, it immediately changes the file. If I change it back to the proper line endings it still says the file has been changed. This will screw up the pull request if I submit it in that state. If you could sniff the first line ending used in the file and default to that, that would be preferred. Same for tabs/spaces in indentations.
If .editorconfig
could be generated from a dialog box instead of assuming wrong when setting up the git repo, that would be helpful. Maybe just having another tab in the project initialization would be another option to think about.
Maybe se should detect the CR style instead, if no editorconfig is present?
Looking at the code, actually it does detect the line ending from the file and only if .editorconfig has end_of_line
then it is forced to whatever it's there.
@SamuraiCrow did you try with the .editorconfig above? Does it work as intended?
Please build Genio from source with the latest commit and let me know. I've tested it with your repo (protrekkr) and it seems fine now.
@jackburton79 Genio should have behaved like this already. Now EndOfLineConvert() is not invoked if .editorconfig is not available. Nevertheless, I'll look into this more closely as soon as possible.
Tested on 32 bit. It works on ToT (Tip of Tree).
On Genio v3.1, whenever I load a source code that uses Windows line endings, the editor switches it to Unix line-endings without asking. It is only detectable by the way that the document is marked immediately as being modified as soon as it is loaded.