mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Fix varbox that should autocomplete the current word
This commit is contained in:
@@ -54,6 +54,9 @@ static inline size_t TokenLength(mp_lexer_t * lex, const char * tokenPosition) {
|
||||
return lex->column - lex->tok_column;
|
||||
}
|
||||
bool PythonTextArea::shouldAutocomplete(const char * autocompletionLocation) const {
|
||||
if (isAutocompleting()) {
|
||||
return true;
|
||||
}
|
||||
const char * location = autocompletionLocation != nullptr ? autocompletionLocation : cursorLocation();
|
||||
CodePoint prevCodePoint = UTF8Helper::PreviousCodePoint(m_contentView.editedText(), location);
|
||||
return !UTF8Helper::CodePointIsEndOfWord(prevCodePoint)
|
||||
|
||||
@@ -18,6 +18,9 @@ public:
|
||||
void unloadSyntaxHighlighter() { m_contentView.unloadSyntaxHighlighter(); }
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
bool handleEventWithText(const char * text, bool indentation = false, bool forceCursorRightOfText = false) override;
|
||||
/* shouldAutocomplete returns true if there is currently autocompletion, or if
|
||||
* there should be autocompletion but there is not because there is no word to
|
||||
* autocomplete. */
|
||||
bool shouldAutocomplete(const char * autocompletionLocation = nullptr) const;
|
||||
bool isAutocompleting() const { return m_contentView.isAutocompleting(); }
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user