fix: AI输入的时候鼠标可以失去焦点

This commit is contained in:
liuweiqing 2024-02-03 14:06:26 +08:00
parent 65da583258
commit 88063baa2e

View File

@ -176,12 +176,13 @@ async function processResult(reader, decoder, editor) {
dataObject.choices[0].delta?.content;
if (content) {
// 在当前光标位置插入文本
editor.focus();
editor.insertText(editor.getSelection().index, content);
// console.log("成功插入:", content);
}
}
} catch (error) {
console.error("Failed to parse JSON object:", jsonStr);
// console.error("Failed to parse JSON object:", jsonStr);
console.error("Error:", error);
break;
}