Line Numbers in Text Editor

BNig niggemann at uni-wh.de
Sat Jun 26 10:35:36 EDT 2010


Hi Alex, 
I gave it a try:

as revlet
http://berndniggemann.on-rev.com/textLineNumbers/
as zipped stack
http://berndniggemann.on-rev.com/textLineNumberStack/

is a proof of principle, seems to work though. Sometimes a little awkward :)

regards
Bernd



Alex Tweedly wrote:
> 
> The straightforward answer is using formattedText ..... but the deeper 
> question is what line numbering you want for the lines when there is 
> line-wrapping happening. For instance, if it is something like a source 
> code editor, then the line numbers (IMHO) should be independent of the 
> size of window currenty in use.
> 
> For example,  if I have the following text
> 
>   1   My first line
>   2 this is a very long line of text that is going to be wrapped in a 
> moment when I make the window narrow.
>   3 third line.
> 
> Then when the window becomes narrow, do I *want*
> 
>   1   My first line
>   2  this is a very long line of text that is going to be wrapped
>   3  in a moment when I make the window narrow.
>   4  third line.
> 
> or do I want something like
> 
>   1   My first line
>   2   this is a very long line of text that is going to be wrapped
>   2a  in a moment when I make the window narrow.
>   3   third line.
> 
> It really depends on whether you are numbering the lines of the window 
> or the lines of the underlying text (or source code, or whatever); quite 
> often, I suspect, it should be the latter. And in that case I don't know 
> of any quick or easy way to figure out how the numbering should be done
> :-(
> 
> -- Alex.
> 
> 
> 
> On 25/06/2010 08:25, Justin Sloan wrote:
>> I went with using a parallel field to add line numbers and it is
>> working well. However, rev only counts the line numbers based on the
>> delimeter. So if word warp is turned on you end up with more lines
>> then there are actual line numbers.
>>
>> Does anyone know of a way to count all the lines, even the lines that
>> are wrapped and not separated by the delimeter?
>>
>>   - Justin
>>
>>
>>
>> On Thu, Jun 24, 2010 at 5:44 PM, Jeff Massung<massung at gmail.com>  wrote:
>>    
>>> I used a parallel field in my Cryogen editor (http://massj.tumblr.com
>>> for
>>> video + screenshot). Worked out perfectly, and now that I've done it
>>> that
>>> way once, I actually wouldn't want to do it any other way in the future.
>>>
>>> Jeff M.
>>>
>>> On Thu, Jun 24, 2010 at 6:01 AM, Justin
>>> Sloan<justin.sloan at us.army.mil>wrote:
>>>
>>>      
>>>> I am planning to implement line numbers in a proprietary text editor
>>>> that I wrote for in-house use.  Problem is, I don't know how I am
>>>> going to implement it. I thought about using a parallel text field,
>>>> but there has to be an easier way.  Any of you genius devs have any
>>>> ideas?
> 
-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Line-Numbers-in-Text-Editor-tp2266755p2269436.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list