I have finally got the go ahead to put tui-textarea into gitui. I see that tta is now up to v0.4 and that now includes the keyboard based selection. I now see how you modified my original code.
The problem is that its very hard to use in the case where I am not using the keyboard dispatched via input. The new code there uses move_cursor_with_shift, this what I would have done except that it would have changed the existing API which I wanted to avoid. Which is why I came up with other stuff. Having a shift aware API makes it really easy (as your code shows), but that function is private.
Instead the non input using caller as to use start_selection and stop_selection. This means that I now have to reimplement the logic I already had in my original version that turns the selection on and off as the shift key is toggled, thats really tricky , even trickier outside TTA not having access to its insides (like is a selection already in progress?)
A simple solution would be to make the move_cursor_with_shift public, which would in fact make start_selection redundant (I think)
I think I can do the tricky thing for now but its not at all obvious what a caller needs to do (in the doc) and no samples show it either.
I have finally got the go ahead to put tui-textarea into gitui. I see that tta is now up to v0.4 and that now includes the keyboard based selection. I now see how you modified my original code.
The problem is that its very hard to use in the case where I am not using the keyboard dispatched via
input
. The new code there usesmove_cursor_with_shift
, this what I would have done except that it would have changed the existing API which I wanted to avoid. Which is why I came up with other stuff. Having a shift aware API makes it really easy (as your code shows), but that function is private.Instead the non
input
using caller as to usestart_selection
andstop_selection
. This means that I now have to reimplement the logic I already had in my original version that turns the selection on and off as the shift key is toggled, thats really tricky , even trickier outside TTA not having access to its insides (like is a selection already in progress?)A simple solution would be to make the
move_cursor_with_shift
public, which would in fact make start_selection redundant (I think)I think I can do the tricky thing for now but its not at all obvious what a caller needs to do (in the doc) and no samples show it either.