Open tkefauver opened 3 weeks ago
Everything is related to the current composition region and that is the current surrounding text. The surrounding text is the current line because that is the biggest context that is needed to be able to do auto completion etc.
There is no point in querying the whole text. Keep in mind a text buffer has no limitations.
Where is the bug?
There is no point in querying the whole text.
You limit the length in the request, its supposed to be able to provide the whole text.
It only provides info for the VISUAL line from wherever it wraps which could be in the middle of hyphenated word and completion needs the full word.
Another example if the caret is at the beginning of some line it'll report SelectionStart == 0. When you move to the beginning of ANOTHER line, it'll still report 0! Which means there's no comparable way to know the caret changed without also looking at the new line querying the connection every cursor change (becomes inefficient).
Its just not how other native textboxes respond to the API's. So I guess this is more of a feature request than bug...
https://developer.android.com/reference/android/view/inputmethod/ExtractedText
This clearly states ExtractedText is just some portion of the whole text that is currently being editited.
I agree that wrapped text lines should not be split we can fix that.
Describe the bug
GetExtractedText is supposed to be relative to the full contents of a textbox. Avalonia textboxes only return information about the current line.
To Reproduce
To reproduce you'll need a whole keyboard service here's a basic setup:
InputMethodService
in the android project, declared like this:AndroidManifest.xml
:method.xml
inResources/xml
like this:OnStartInput
and callGetExtractedText
like this:OnCreateInputView
and create/inflate some view (this might not be necessary)response
info is relative to the current line onlyExpected behavior
The
Text,SelectionStart,SelectionEnd
properties inresponse
should be relative to the full multiline textAvalonia version
11.1.4
OS
Android
Additional context
This is just a way to demonstrate the issue. Other
IInputConnection
methods likeGetTextBeforeCursor
andGetTextAfterCursor
do the same thing