Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Indent detection warnings
dmoore:
Finally discovered the indent detection setting the other day (started playing with a project that uses tab indents in its sources). Surprised that this isn't on by default!!
Wondering if it should be made more like how the automatic endline detection works, with a warning shown in an info popup when mixed tab/space indents are detected. A patch is attached. Thoughts?
oBFusCATed:
IndentData's c-tor should be explicit. Most of the time it is better to use initializers instead of copying.
The usage of eolModeStr seems like a copy-paste mistake:)
I can't comment on the functionally though :)
dmoore:
--- Quote from: oBFusCATed on February 24, 2014, 08:49:01 pm ---IndentData's c-tor should be explicit. Most of the time it is better to use initializers instead of copying.
--- End quote ---
Good point -- just dawned on me that you could just do "return 8" which would become "return IndentData(8,false)".
--- Quote ---The usage of eolModeStr seems like a copy-paste mistake:)
--- End quote ---
:P
--- Quote ---I can't comment on the functionally though :)
--- End quote ---
It's great, of course!
Alpha:
Something of note, this function currently limits itself to scanning the first 1000 lines of a file, which can result in false negatives from the warning message added by your patch.
dmoore:
--- Quote from: Alpha on February 24, 2014, 11:56:51 pm ---Something of note, this function currently limits itself to scanning the first 1000 lines of a file, which can result in false negatives from the warning message added by your patch.
--- End quote ---
Yeah that'that's a problem. What do you propose? Scan everything? Might be prohibitively slow. Probably would be sufficiently cheap to global search for EOL+tab and EOL+space for mixed detection and retain the other logic for type/length detection. I will try that.
Another idea would be to just notify if changing from the users preferred indentation choice, but that's not quite as informative as being told that there are mixed indents.
Does the auto EOL feature have this problem?
Btw, does anyone know what the editor setting "TAB Indents" does?
Navigation
[0] Message Index
[#] Next page
Go to full version