mirror of
https://github.com/ahmetildirim/obsidian-inscribe.git
synced 2026-07-22 05:44:10 +00:00
Trim whitespace from completion suggestions in CompletionService
This commit is contained in:
parent
a72a211f48
commit
b1cd150ec6
1 changed files with 2 additions and 1 deletions
|
|
@ -71,7 +71,8 @@ export default class CompletionService {
|
|||
private async *complete(editor: Editor, provider: Provider, prompt: string, options: CompletionOptions): AsyncGenerator<Suggestion> {
|
||||
this.notifyCompletionStatus(true);
|
||||
for await (const text of provider.generate(editor, prompt, options)) {
|
||||
yield { text };
|
||||
// trim the text to remove any leading or trailing whitespace
|
||||
yield { text: text.trim() };
|
||||
}
|
||||
this.notifyCompletionStatus(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue