What is the tab width (number of spaces indented for a tab) within code tags? Is it 8? Is it possible to change it to 4? Since the code is wrapped for lines with length less than 80 characters, I think that it is a waste of space.
WolfPack 491 Posting Virtuoso Team Colleague
Recommended Answers
Jump to PostThis contains a tab This contains 4 spaces But this contains 8 spaces
Just testing. I used Notepad to create the above text
My suggestion is to change the option in your text editor to convert tabs to spaces because some people might use 8 spaces while others 4 …
Jump to PostThe question is one of indentation, not embedded tabs. You only have to worry about the consecutive tabs at the beginning of a line:
$post_data =~ s/\n(\t+)/' ' x (tab_stop * length($1))/e;
Where post_data is your string and tab_stop is the number of desired spaces to replace tabs with.
Jump to Post>basically you're saying to convert tabs to spaces only when the tab
>is at the beginning of the line (i.e. when \t is directly following \n)
Yep.>That would break the following scenerio:
I'm not sure that finding edge cases is productive. If you have the option of turning …
Jump to Post>Also, why do you have to artificially break lines?
Because I know how to wrap my own code better than some automated thingamajig.
Jump to Post>As you can see, I don't have to go very far back to demonstrate how often things would be broken.
Nothing would be broken if what we have now remains the default, and only a special tag option changes the behavior. ;) Though since we have enough people posting code …
All 34 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
WolfPack 491 Posting Virtuoso Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
John A 1,896 Vampirical Lurker Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
John A 1,896 Vampirical Lurker Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
John A 1,896 Vampirical Lurker Team Colleague
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Dani 4,658 The Queen of DaniWeb Administrator Featured Poster Premium Member
Narue 5,707 Bad Cop Team Colleague
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.