red / REP

Red Enhancement Process
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

WISH: A reflective area facet that indicates/manipulates the cursor position #76

Open temperfugit opened 4 years ago

temperfugit commented 4 years ago

I have a couple of ideas I'd like to play with which would require me to know and be able to change the location of the caret in an area.

In 2017 a similar request was made and deferred, DocKimbel commented that text-box (which I think became rich-text) was on the way and may be integrated into area, which would then expose caret information. That has not happened (I expect it will eventually) and perhaps in the meantime we could get caret info in area?

In 2018 a more thorough request was made for selection, scroller and caret control. I don't know the progress of scroller but a reflective selected facet has been implemented since then. Doc's note on caret manipulation at the time was:

For caret, we need to find the facet that fits it the best, or provide separate conversion functions, if maintaining the realtime binding between the facet and the OS API is too expensive.

greggirwin commented 4 years ago

Have you read up on https://doc.red-lang.org/en/rtd.html? @toomasv is the most experienced with it I think, and has some great examples out there.

temperfugit commented 4 years ago

I've played around with RTD's multi-box mode a fair amount. I like it a lot but it's a lot of work to make a fully functional text editor out of it.

I have a very rough, semi-functional rich-text editor prototype that I've been playing around with, but life intervenes and I've stalled out on it. Basically it uses text stored as a block of strings that are split at line breaks. Each on-screen paragraph is rendered in its own rich-text box (but all on the same rich-text pane). Even if or when it gets finished it would be nowhere near as portable or as easy to deploy as a View widget would be. I realized this week that what I wanted it for I could do with area instead, if I could manipulate the caret directly---which is why I posted this wish :)

greggirwin commented 4 years ago

Good feedback, thanks. :+1: