fix: AI输入的时候鼠标可以失去焦点
This commit is contained in:
parent
65da583258
commit
88063baa2e
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user