[REBOL] Re: cursor line
From: brett:codeconscious at: 17-Aug-2001 15:31
Hi Jim,
system/view/caret is pointing to the "same" text as my-area/text but is just
at a different series index which shows where the cursor is. You can see
this by printing
head system/view/caret
So based on that here's my little way of finding the line, by counting the
number of line breaks:
text-b4-cursor: copy/part head system/view/caret system/view/caret
parse/all text-b4-cursor [
(line-num: 1)
some [thru newline (line-num: add 1 line-num)]
to end
]
Line-num is left with the line number. I haven't thoroughly tested it but it
may help. No doubt someone else has a
more elegant solution for you.
Brett.