mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Autocomplete only at the end of the word
For instance, if the cursor is: "he|llo" and the user adds the letter 'i', there is no autocompletion provided as the cursor is still in the middle of a word.
This commit is contained in:
@@ -246,9 +246,11 @@ void PythonTextArea::addAutocompletion() {
|
||||
const char * autocompletionLocation = const_cast<char *>(cursorLocation());
|
||||
const char * textToInsert = nullptr;
|
||||
CodePoint prevCodePoint = UTF8Helper::PreviousCodePoint(m_contentView.editedText(), autocompletionLocation);
|
||||
if (!UTF8Helper::CodePointIsEndOfWord(prevCodePoint)) {
|
||||
if (!UTF8Helper::CodePointIsEndOfWord(prevCodePoint)
|
||||
&& UTF8Helper::CodePointIsEndOfWord(UTF8Helper::CodePointAtLocation(autocompletionLocation)))
|
||||
{
|
||||
/* The previous code point is neither the beginning of the text, nor a
|
||||
* space, nor a \n.
|
||||
* space, nor a \n, and the next code point is the end of the word.
|
||||
* Compute the text to insert */
|
||||
// TODO LEA
|
||||
textToInsert = "test";
|
||||
|
||||
Reference in New Issue
Block a user