Add settings for cache of changes

This commit is contained in:
Petr Mironychev
2024-09-11 01:59:25 +02:00
parent 2fb876ff00
commit 8e052ff45c
7 changed files with 32 additions and 10 deletions

View File

@ -32,6 +32,7 @@
#include "LLMClientInterface.hpp"
#include "LLMSuggestion.hpp"
#include "core/ChangesManager.h"
#include "settings/ContextSettings.hpp"
#include "settings/GeneralSettings.hpp"
using namespace LanguageServerProtocol;
@ -85,7 +86,11 @@ void QodeAssistClient::openDocument(TextEditor::TextDocument *document)
if (!textEditor || textEditor->document() != document)
return;
ChangesManager::instance().addChange(document, position, charsRemoved, charsAdded);
if (Settings::contextSettings().useProjectChangesCache())
ChangesManager::instance().addChange(document,
position,
charsRemoved,
charsAdded);
TextEditorWidget *widget = textEditor->editorWidget();
if (widget->isReadOnly() || widget->multiTextCursor().hasMultipleCursors())