I am assuming there is a “bug” in TextArea (macOS)… and does anyone know of a “workaround”
I have this line of code
cl=theEditor.LineNumAtCharPos(theEditor.SelStart) // line the cursor is on
theEditor is a TextArea control
here it the “problem”
as a test I typed in 8 characters
123
4
and got the following … CL=line #, SS=SelStart
CL=0 SS=1 … “1”
CL=0 SS=2 … “12”
CL=0 SS=3 … “123”
CL=0 SS=4 … 123"
CL=0 SS=5 … “1234”
CL=1 SS=6 … “1234”
CL=1 SS=7 … “1234”
CL=2 SS=8 … “1234”
SS 1 to 3 I expected CL=0 and got 0
SS 4 expected CL=1 but still 0
SS 5 expected CL=1 but still 0
SS 6 expected CL=2 but got 1
SS 7 expected CL=3 but got 1
SS 8 expected CL=4 but got 2
It seems to not consider any line that is “” or a single character
If the line consists of TWO or more characters it “increments” the linenumber… but any previous blank lines muff the calculation
this text has NO soft breaks (ie. no wrapping)
I tried this in 2018r3 and same thing
Perhaps a RegEx that can count the EndofLine in a limited length of text?