Page 1 of 1

Text formatting (tabs)

Posted: Mon Sep 19, 2016 5:17 am
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.

Re: Text formatting (tabs)

Posted: Sat Mar 11, 2017 5:43 am
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.

Re: Text formatting (tabs)

Posted: Sat Mar 11, 2017 2:40 pm
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

Re: Text formatting (tabs)

Posted: Sat Mar 11, 2017 3:04 pm
by Vadi
Yeah that's what Mudlet will pretty much do, think that trigger won't match anything anymore, just a heads up