User forums > General (but related to Code::Blocks)
Word wrap and indentation
carra:
While I normally don't need to use word wrap, I have been surprised that it behaves differently in Code::Blocks than in some other editors, in my case Notepad++. Roughly, the wrapping schemes are these:
CODE::BLOCKS style
--- Code: ---namespace MyNames
{
void Function()
{
if( Condition )
{
SomeVeryLongCall( param1,
param2 );
}
}
}
--- End code ---
NOTEPAD++ style
--- Code: ---namespace MyNames
{
void Function()
{
if( Condition )
{
SomeVeryLongCall( param1,
param2 );
}
}
}
--- End code ---
I'd like to hear your opinions on this. Mine is that, in the context of coding and other structured documents (like XML) indentation should be kept to not harm visual structure and readability. Or, at least, it would be nice to be able to choose it, if wxScintilla allows the option.
MortenMacFly:
--- Quote from: carra on October 09, 2012, 04:07:23 pm ---While I normally don't need to use word wrap, I have been surprised that it behaves differently in Code::Blocks than in some other editors
--- End quote ---
You can setup the wrapping behaviour in the editor options as desired.
dmoore:
In scintilla you can control how word wrap is indented (this has no impact on the editor data, just how wrapped lines are displayed) using SCI_SETWRAPINDENTMODE (see here). We don't currently support these options in C::B, so someone would need to make a patch. I don't have a strong opinion on whether indentation should be on by default or whether it should be the same for all languages.
MortenMacFly:
--- Quote from: dmoore on October 09, 2012, 04:31:27 pm ---SCI_SETWRAPINDENTMODE
--- End quote ---
OK - that's another story. What I meant was SmartIndent and alike. This is already implemented.
dmoore:
The simplest fix would be to turn on SC_WRAPINDENT_SAME as the default for all editors. If noone objects, one of us could easily do this. An example of when this might (and I say might) be undesirable is for plain text mode. Other people might not like the feature, but I am not sure it is worth cluttering the settings with yet another option. Thoughts?
Navigation
[0] Message Index
[#] Next page
Go to full version