Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Auto detect indent style
Alpha:
Smart idea, thanks. (Sometimes, it seems, I miss that which should be obvious :-\...)
Alpha:
The attached patch should correctly identify (and set) the indentation style per editor, or, if identification is not strong enough, fallback to user defaults.
ollydbg:
I see some source code which have both spaces and tabs in the same line. But I see that your patch handle either line begin with pure tabs or lines begin with pure spaces, right?
For example, the GDB's source code
a tab length = 8 space
but GDB's indent length = 2 space
I'm not sure your algorithm can detect this. :)
Alpha:
--- Quote from: ollydbg on March 16, 2013, 10:49:10 am ---I'm not sure your algorithm can detect this. :)
--- End quote ---
Correct. During my testing, I had no idea what the correct settings even would be in this situation. I decided that in the case of mixed spaces/tabs, just allow the tab key to emit actual tabs, letting the programmer decide when/where they want to use tabs and spaces.
ollydbg:
My idea is:
1, firstly, guess the tab's length
2, secondly, guess the indent's length
I'm not thinking details. ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version