User forums > Help

Detect file EOL

(1/3) > >>

zach:
I'm sorry if this very basic question was asked before, I could not find any help online.

How do I enable automatic EOL detection for a project that needs to specify its own coding style (tab-width, etc) ?
(This project requires a uniform tab-width but has files with different EOL characters due to cross-platform development)

At /Project/Properties/EditorConfig options/ I can't seem to set EOL mode to "AUTO" like I can globally at /Settings/Editor/General Settings/Editor Settings/.
I'm on Ubuntu using Code::Blocks 16.01.

oBFusCATed:
So what is the exact question? How to make editor-config use auto-eol or something else.
Also what do you expect from auto-eol? At the moment it chooses the eol which is used the most or some other similar heuristic.
As far as I know it doesn't preserve the eol from the current line when you press enter.

zach:

--- Quote from: oBFusCATed on November 24, 2017, 08:53:28 pm ---So what is the exact question?
--- End quote ---
There is only one question in my OP which I think makes the issue very clear.


--- Quote from: oBFusCATed on November 24, 2017, 08:53:28 pm ---How to make editor-config use auto-eol
--- End quote ---
Exactly.


--- Quote from: oBFusCATed on November 24, 2017, 08:53:28 pm ---At the moment it chooses the eol which is used the most or some other similar heuristic.

--- End quote ---
This doesn't work.


--- Quote from: oBFusCATed on November 24, 2017, 08:53:28 pm ---Also what do you expect from auto-eol?

--- End quote ---
Obviously I expect CB not trying to be super clever and just set the EOL char to which is most used in the current file like even the simplest editor can do.

Currently you can't have both, change project-specific editor config (tab-width etc) and auto-detect the EOL.
The former is mandatory which overrides the global auto-eol setting and messes up my files with mixed EOLs.

I'm pretty shocked CB doesn't have this to say the least.


EDIT:
I can avoid the issue by manually setting "eol_mode" to "3" in the .cbp project file.
Unfortunately this value gets overwritten on every project property update + save so this is not at all an applicable workaround.

zach:
Maybe related bug:

Closing and reopening a file with mixed EOLs (many CR-LFs occasional LFs) shows a pop-up saying
"Mixed line-endings found, setting mode CR-LF"
but EOL mode of the the editor remains set at LF, which is also my project-specific EOL setting (in lieu of a missing project-wide auto-eol setting).

So maybe the whole issue could qualify more as a bug, which imho doesn't make it less serious..

sodev:
Fix your files! Get rid of that mixed EOL style, causes too many issues, also stick to one whitespace mode, at least per file.

Every current rcs converts your files to your current platform style or lets you set a fixed style.

Navigation

[0] Message Index

[#] Next page

Go to full version