Quote:
Are the line numbers along the left margin and the line:column in the lower corner also coming from richedit?

No, no they are not. Microsoft chose to make us jump through a hoop of fire to extract this information ourselves from richedit. Implementing support for this required code of mind-boggling and convoluted complexity. I have to wear goggles when approaching it and even then there is a minimum safe distance of about five metres.

Quote:
... the long line can wrap at various positions

Right. That was exasperating. This took several hours to track down. Initially, I was not able to reproduce this as I was testing it in the aliases section. I then noticed that it reproduced in all the other sections. So I reviewed all of the script editor code to see if the aliases section was doing something different. Two hours later, after not finding anything, I concluded it must have something to do with the contents of the text in the aliases section. I eventually whittled it down to one line that contained a combination of unicode charcters. Apparently, these were enough to disable wrapping.

It also turns out that on Windows Vista and onwards it is now possible to extended the wrapping length by using EM_SETTARGETDEVICE with a large value. However, in my tests this still wrapped text at just over 8192 characters. I was also able to do the same thing by initially inserting the same set of unicode characters into the editbox.

Unfortunately, once the editbox does start wrapping, none of the Windows APIs will return the correct indexes for the lines. An application literally has to retrieve and scan each line in the editbox up to the currently visible line for soft returns and perform calculations that way, which is impractical if the editbox has a large amount of text. I did find a convoluted solution in the MASM forums but it will not be practical for the maximum amount of text that the script editor editbox allows, ie. one megabyte, and would slow down line calculations to a crawl with each typed character.

I have applied the increased wrap length setting to the script editor in the next beta, so it should allow longer lines without wrapping. However, until the APIs are improved, if the lines do wrap, we will have to live with the line numbers being incorrect.