Hello!
Does anybody know how to configure Mudlet's output window to use hanging indent? That is, if text is wrapped, first line of it is flush to left margin, and subsequent lines are all indented.
Thanks in advance.
Hanging indent
-
- Posts: 23
- Joined: Tue Mar 01, 2011 10:00 pm
Re: Hanging indent
You'll want to check out Preferences --> Main Display --> Word wrapping. There's two options "wrap lines at", and "indent wrapped lines by", I daresay what you're looking for is the second option. :]
However, one caveat I can think of is that there's no automatic adjustment for how much it indents based on the previous line, so you basically just pick a number of spaces to indent, and that's what you get.
However, one caveat I can think of is that there's no automatic adjustment for how much it indents based on the previous line, so you basically just pick a number of spaces to indent, and that's what you get.
-
- Posts: 5
- Joined: Sat Mar 04, 2017 9:31 pm
Re: Hanging indent
Thanks. But I'm afraid that the option there only yields normal indent (first line of paragraph indented to the right, the rest of the lines flush to left margin). What I'm looking for is hanging indent, where in wrapped paragraph first line is flush with the margin, while subsequent lines are indented. Here's description and illustration to how it should look: http://www.webopedia.com/TERM/H/hanging_indent.html
Re: Hanging indent
Can you put in a negative number for the indent distance?
-
- Posts: 5
- Joined: Sat Mar 04, 2017 9:31 pm
Re: Hanging indent
Nope, I tried. It would be logical, but no - Mudlet won't let me put a negative number there.
Re: Hanging indent
Well, then right now, there is probably no way you can get a hanging indent on wrapped lines. But I'm sure you could put in a feature request asking for it.
-
- Posts: 5
- Joined: Sat Mar 04, 2017 9:31 pm
Re: Hanging indent
Thanks; I guess I'll write the request, and in the meantime will try and see if it's possible to do own wrapping in Lua somehow.
Re: Hanging indent
Well, that you could do, actually. Basically you need to create a "Lua Function" trigger. The function it checks will be where you normally put a pattern for the trigger, and if the function returns true, I think it will then run the code in the normal code block. Given what you are trying to do, I would just leave the code block empty, and do everything in the single function. It could look something like this:
Note that this function does NOTHING to maintain colors. Adding that would add notably more complexity, but should be possible.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Hanging indent
I have been looking in that area of the code base recently and I cannot say I was really that much whelmed by the current behaviour {I need to do something because in the on-going work striving towards I18n our current development code will have difficulties with non-Basic Multi-Plane characters e. g. Oh bu***r the forum throws an error when I try to post a message containing such characters and other things such as combining diacriticals}.Ulenspiegel wrote:Thanks. But I'm afraid that the option there only yields normal indent (first line of paragraph indented to the right, the rest of the lines flush to left margin)...
Although each line may get wrapped if it exceeds the given limit, if there are several such lines in succession they are each considered and wrapped individually which may not be quite what users expect. Of course any simple fix to reflow the wrapped around text is probably going to break something for some existing scripts so it may not be that simple a job. In your case where you say the first line is indented - was it indented by you putting spaces in (or did it come from the MUD server with them) because the "wrapping" action seems to justifiable only kick in if an individual line exceeds the given limit and THEN it is wrapped on its own. From what I recall either the start of the original line would be left flush and the portion that was wrapped around was indented by the given amount or visa-verse (I cannot remember which) but the next line of the original text was then treated so it too either started left flush and the "overflow" was indented (or the opposite way around). I.e.:
would get converted to something like:Code: Select all
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
or like:Code: Select all
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Neither of which may be quite what you were expecting...!Code: Select all
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.