Line numbers for soft-wrapped styled text?

Alex Tweedly alex at tweedly.net
Thu Mar 30 06:01:24 EDT 2017



On 29/03/2017 19:20, Jim Lambert via use-livecode wrote:
> Now that I think about it, I’ve overcomplicated things.
> You don’t need two fields at all.
> Just set the liststyle of the field that contains your editable text to ‘decimal’.
> Then the lines will be automatically numbered and outdented.
> Yet conveniently, the ’text’ and the ‘styledtext’ runs will not ‘contain' the numbering since it is a styling.
>
> Of course, this still doesn’t allow you to get rid of the trailing period on the numbers.
>
>
Not so quick, Jim :-)

This simpler method will indeed work for many (maybe most?) use cases. 
However, this thread got started with Richard G. asking about

> I have an app that allows the user to write styled text, in which any 
> portion of that text may have a variety of styles and sizes, and may 
> be long enough to soft-wrap.
>
> I'd like to add a line-number field next to it, but I haven't come up 
> with an efficient way of setting up those line numbers so that they 
> align vertically with the lines next to them. 

It's likely these user-applied styles should include numbered or 
bulleted lists - which would clash with using decimal-numbered-lists for 
line numbers.
So I think there's a good justification for both of your solutions
  - the simple one for simple cases
  - the two-field version where it is needed

-- Alex.




More information about the use-livecode mailing list