Closed Bodmo closed 3 days ago
I just recognized that multiple selections are officially not supported for input fields and text areas in HTML5. So I guess we have to stick to:
{
selected:[4,4]
}
(nothing selected, cursor at offset 4). and
{
selected:[4,7]
}
(selection ranges from offset 4 to 7).
no problem for me.
I added a fix in Gerrit (9051).
yes, it works correctly. I just noticed that we have to keep in mind that the selection range [a b] means: the characters starting at a till the last character before b. E.g. if "bin" is selected in the Query "ich bin hier" the selection is [4 7]. Another probably more intuitive schema would have been [4 6] = selection from position 4 to pos. 6 (including 6) and for the cursor position without selection [4 -1].
It would be nice if the Plugin-System could allow plugins to fetch the current cursor position and eventually the marked text area(s) on the Kalamar query line, too.
This info would idealy be fetched through the 'get/QueryForm' interface that is already in use. The returned object would return 2 new properties named 'cursor' and 'marked', as e.g.:
{ ... cursor: 4, marked: [5,8,10,12] }
Notice: the Kalamar query line allows for more than 1 marked areas, so the value of 'marked' should be an array of value pairs, where the value pairs indicate the start and end pos. of a marked area.