Display of tabulator chars in Mudlet

Post Reply
User avatar
Zaphob
Posts: 104
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Display of tabulator chars in Mudlet

Post by Zaphob » Sun Nov 03, 2013 12:14 am

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:
Attachments
Mudlet_tabulators.png

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

Re: Display of tabulator chars in Mudlet

Post by Jor'Mox » Sun Nov 03, 2013 12:53 am

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.

User avatar
Zaphob
Posts: 104
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Display of tabulator chars in Mudlet

Post by Zaphob » Sun Nov 03, 2013 1:11 am

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:
Attachments
Mudlet_tabulators.png

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

Re: Display of tabulator chars in Mudlet

Post by Jor'Mox » Sun Nov 03, 2013 1:57 am

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.

User avatar
Zaphob
Posts: 104
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Display of tabulator chars in Mudlet

Post by Zaphob » Sun Nov 03, 2013 10:59 am

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()
Attachments
Mudlet_tabulators.png
Last edited by Zaphob on Sun Nov 03, 2013 6:06 pm, edited 1 time in total.

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

Re: Display of tabulator chars in Mudlet

Post by Jor'Mox » Sun Nov 03, 2013 5:00 pm

That is what I get for just throwing something together and not testing it. ;)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests