[Lazarus] SynEdit.TextBetweenPoints (Martin?)
Bart
bartjunk64 at gmail.com
Sat Aug 10 22:18:08 CEST 2019
On Sat, Aug 10, 2019 at 9:09 PM Martin Frb via lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> I added 2 fixes (one for the other mail / empty edit). Please test.
I think the fix for empty selection is allright.
It will not completely solve my issue (the second SetTextBetweenPoints
also moves BlockEnd), which makes sense I guess, since in essence I
want BlockEnd to "move" with the first call, but remain with the
second call, and in each call BlockBegin=BlockEnd.
I adjusted my code to deal with that (if no text is selected I restore
BB and BE as needed).
The situation with Lines.Count=0 even got worse: it now places Post in
front of Pre, so you get '}{' instead of "{}'.
As a side effect of that, the caret is in between the } and { (which
is where I wanted them to be ;) )
Here's the debug output for that situation:
BlockBegin =1,1
BlockEnd =1,1
SelLength =0
BackwardsSel=FALSE
Lines.Count =0
After SetLogicalCaret (LogicalCaretXY := Blocken, which is 1,1)
BlockBegin =1,0 <<====== ???
BlockEnd =1,1
After SetTextBetweenPoints(BB,BB,...)
BlockBegin =1,1
BlockEnd =1,1
After SetTextBetweenPoints(BE,BE,...)
BlockBegin =2,1
BlockEnd =2,1
After SetLogicalCaret
BlockBegin =2,1
BlockEnd =2,1
--
Bart
More information about the lazarus
mailing list