Text formatting (tabs)

Post Reply
User avatar
tincan
Posts: 13
Joined: Sun Sep 11, 2016 8:01 am

Text formatting (tabs)

Post by tincan »

I [once] code[d] on the mud I've recently started replaying. I previously used zMUD and never noticed this issue before, but when I look at my directory, the files/subdirectories do not fall into a nice even pattern.
Copying/pasting here with as code lines it up better (more what I'm used to without proper formatting/tabbing), but Mudlet doesn't show it as so.

Image
vs

Code: Select all

ls
.mailrc.o		games/			rangers/
.mbox			ghost_village/		stuff/
ACCESS			lab/			toys/
WILL			log/			village/
a******/		open/			weap1.c
arena/			pasture/		weap2.c
bravo_return.txt	private/		workroom.bak
cribbage.c		qc/			workroom.c*
Is there some sort of way of tweaking the tab to get things lined up a bit better? It's not a huge deal really... but if there's a setting I'd love to tweak with it.

Note: I've fiddled with the settings under Settings -> Main Display to no avail.
I was sane once. I got better.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Text formatting (tabs)

Post by Vadi »

The upcoming 3.0 preview will handle tabs a bit better, but in general, they are a problem as afaik there is no standard out there to define what to do with a tab exactly. Its better if the game uses spaces for exact alignment it wishes.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Text formatting (tabs)

Post by Jor'Mox »

Since they apparently don't want to handle them, I just have a trigger that looks for \t, and then runs this:
Code: [show] | [select all] lua
function fix_tabs()
    local text = line
    local pos = string.find(text,"\t")
    repeat
        selectString("\t",1)
        replace(string.rep(" ",8 - math.fmod(pos,8)))
        text = string.gsub(text,"\t",1)
        pos = string.find(text,"\t")
    until not pos
end

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Text formatting (tabs)

Post by Vadi »

Yeah that's what Mudlet will pretty much do, think that trigger won't match anything anymore, just a heads up

Post Reply