feat: Add settings for ignore space and tab in codecompletion char count

This commit is contained in:
Petr Mironychev
2025-11-20 17:37:00 +01:00
parent 1e3b1997cc
commit 90655cded4
4 changed files with 18 additions and 3 deletions

View File

@ -152,14 +152,16 @@ void QodeAssistClient::openDocument(TextEditor::TextDocument *document)
}
bool isSpaceOrTab = lastChar[0].isSpace();
bool ignoreWhitespace
= Settings::codeCompletionSettings().ignoreWhitespaceInCharCount();
if (!isSpaceOrTab) {
if (!ignoreWhitespace || !isSpaceOrTab) {
m_recentCharCount += charsAdded;
}
if (m_typingTimer.elapsed()
> Settings::codeCompletionSettings().autoCompletionTypingInterval()) {
m_recentCharCount = isSpaceOrTab ? 0 : charsAdded;
m_recentCharCount = (ignoreWhitespace && isSpaceOrTab) ? 0 : charsAdded;
m_typingTimer.restart();
}