[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Configurable \t width
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Configurable \t width

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Thu 19 Apr 2012 05:21 AM (UTC)
Message
According to the Telnet specification, when encountering a \t the output is to be taken to the first tab stop. Nowhere does it specify when/where such a tabstop is to be.

Is this a configurable option? (I've searched and failed to come up with something amongst all of the tab-completion topics...) If not, can it be made one with the [GS]etOption configurability to go along with it. (That is assuming it is to be a linear function, although every tabstop being configurable would be very nice as well in which case I am not sure how that would be expressed.)

Some games do use \t, and it would be nice to properly be able to influence how that stuff looks. (Without the trigger-affecting mess that changing the packets to spaces is.)

[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 19 Apr 2012 10:46 AM (UTC)
Message
See:

https://github.com/nickgammon/mushclient/blob/master/doc.cpp

Line 2225 (at present):



      case '\t':  i = ((m_pCurrentLine->len + 8) & 0xFFF8);



Looks like it is fixed at 8.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #2 on Thu 19 Apr 2012 11:20 AM (UTC)
Message
Okay. I guess I can deal with the situation being as it is. :-)

Somewhere in my head I could have sworn it was configurable, but looking through things again, I may have remembered the tab-completion characters setting in the global preferences.

Also thanks for the relevant line in the source; while I obviously know of the latters existence I can't say I was in any rush to download and grep the thing for \t, 0x09, plain 9 or whatever it may have been written as. (On the assumption it wasn't configurable, which I wasn't really on to begin with. :))
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] bio
Date Reply #3 on Thu 19 Apr 2012 06:41 PM (UTC)
Message
I suppose that also explains why some text editors are annoying as hell. In most "modern" uses, an indent, which is the most common use of a tab, is 5 characters, and when coding, most sane people don't use more than 2, because the deeper the indent, the fewer nested sections you can have, before the code starts wrapping itself, and making it unreadable. Frankly, I don't even know why they thought it made sense in Telnet. :p
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Fri 20 Apr 2012 04:33 AM (UTC)

Amended on Fri 20 Apr 2012 04:34 AM (UTC) by Fiendish

Message
Quote:
In most "modern" uses, an indent, which is the most common use of a tab, is 5 characters
I don't think I ever encounter editors where this isn't configurable.

Quote:

and when coding, most sane people don't use more than 2

For rapid visual differentiation of nests, most developers I know prefer 3 or 4. 1 or 2 simply isn't enough space difference to easily scan with the eyes. By a more reliable definition of sane, someone sane uses an environment with configurable tab width and just uses actual tabs instead of spaces because we're in the 21st century now and can do modern things with modern software.

Quote:

because the deeper the indent, the fewer nested sections you can have, before the code starts wrapping itself

What? Your lines are too long, your screen is too small, and you seriously nest conditionals way too much if this is a problem for you.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #5 on Fri 20 Apr 2012 08:54 AM (UTC)
Message
Agreed with Fiendish. Tabs are by far superior to spaces; it's just that people insist on mixing them and then tend to go 'tabs are so unreasonable!'.

Fiendish argument is pretty much my line of thought in asking about being able to change this. :)
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Fri 20 Apr 2012 09:39 AM (UTC)
Message
Nowadays I reject tabs in source.

I just change them to spaces. That way I know how it's going to look, in Editor A, Editor B, and when presented on the Web.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #7 on Sat 21 Apr 2012 06:14 PM (UTC)

Amended on Sat 21 Apr 2012 06:33 PM (UTC) by Fiendish

Message
Nick Gammon said:

Nowadays I reject tabs in source.

I just change them to spaces. That way I know how it's going to look, in Editor A, Editor B, and when presented on the Web.

I agree with you for display, but not for multi person editing or other in-house stuff where developers are going to be using development tools. I'd much rather have something on the display end that translates tabs into spaces for web viewing than force every developer in a group to be stuck with a particular indent width. Inevitably you end up with someone contributing source who used an editor that gave 4 spaces instead of 3, or 3 instead of 5, which makes things difficult for everyone involved.

(mixed line breaks are a whole other nightmare which should again just be handled by a smart vcs (Perforce handles this automatically, eg) instead of text editors. Did you know that visual c++ 2008/2010 can just refuse to open code files that have mixed line endings until you fix them in a different editor? mindblowing, right? anyway, I digress.)

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Sat 21 Apr 2012 10:36 PM (UTC)
Message
Fiendish said:

Did you know that visual c++ 2008/2010 can just refuse to open code files that have mixed line endings until you fix them in a different editor? mindblowing, right?


It's "our way or the highway", right?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,537 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]