mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-10-21 11:26:40 -04:00
fix: Empty context for empty file
This commit is contained in:
@ -364,6 +364,12 @@ void EditProjectFileTool::extractContext(
|
||||
if (lineNumber > 0 && lineNumber <= lines.size()) {
|
||||
targetLine = lineNumber - 1;
|
||||
}
|
||||
} else if (mode == EditMode::AppendToEnd) {
|
||||
if (!lines.isEmpty()) {
|
||||
int startLine = qMax(0, lines.size() - contextLines);
|
||||
contextBefore = lines.mid(startLine).join('\n');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (targetLine == -1) {
|
||||
|
Reference in New Issue
Block a user