Page 1 of 1

Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 12:14 am
by Zaphob
Hi all, I found a weird problem. It seems like Mudlet sometimes can't display tabulator chars very well. I have made a few screenshots to illustrate an example which I can reproduce easily. (This example uses the "Activate Time Stamps" button in the bottom of the Mudlet window) The effect is hard to describe for me, because I don't often see overlapping letters or characters in text, and also interesting things happen, when I try and select some of the text with the mouse. If you have any questions, I will be happy to provide more info and/or test some more things. Hope this can be fixed some time! :mrgreen:

Re: Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 12:53 am
by Jor'Mox
The problem, which from what I understand will be fixed in the next release, relates to how Mudlet handles tab characters in lines of text that contain color codes. The result is the overwritten characters that you see. To fix the problem for now, you can create a trigger to replace the tabs with spaces. Use \t as the trigger pattern. What you do to replace the tabs is up to you, but here is some simple code you could use to get you started:
Code: [show] | [select all] lua
line = string.gsub(line,"%t",string.rep(" ",8))
selectCurrentLine()
replace(line)
line = getCurrentLine()
It basically just replaces all tab characters with 8 spaces.

Re: Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 1:11 am
by Zaphob
Jor'Mox wrote:It basically just replaces all tab characters with 8 spaces.
Thanks for the suggested trigger. It sounds nice in theory, unfortunately does not seem to improve much, quite the opposite.

edit: After replacing your %t with \t the trigger seems to do the job! :mrgreen:

Re: Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 1:57 am
by Jor'Mox
Those seem to be some very strangely placed tab characters. You might try just replacing them with an empty string, "". It would certainly clean things up a bit.

Re: Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 10:59 am
by Zaphob
I edited my post afterwards. Your original trigger seems to replace every letter T with the spaces. When I change your pattern "%t" with "\t", it works as expected. Thanks!

My trigger now: start on perl regex: \t

Code: Select all

line = string.gsub(line,"\t",string.rep(" ",8))
selectCurrentLine()
replace(line)
line = getCurrentLine()

Re: Display of tabulator chars in Mudlet

Posted: Sun Nov 03, 2013 5:00 pm
by Jor'Mox
That is what I get for just throwing something together and not testing it. ;)