From 7f3b9b8d84bbfdb1169e706830e245b55f0845b0 Mon Sep 17 00:00:00 2001 From: lijisanxiong <1518062161@qq.com> Date: Thu, 20 Nov 2025 19:56:28 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=B0=83=E6=95=B4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BC=96=E8=BE=91=E5=99=A8=E6=8F=92=E5=85=A5=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/code/code-editor.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/code/code-editor.controller.ts b/src/editor/code/code-editor.controller.ts index 5d4cc99a9..081b4e342 100644 --- a/src/editor/code/code-editor.controller.ts +++ b/src/editor/code/code-editor.controller.ts @@ -177,7 +177,7 @@ export class CodeEditorController const linesAdded = linesInText.length - 1; // 前后换行 + 文本内换行 = 总新增行数 const lastLineOfInsert = insertLine + linesAdded - 1; // 排除末尾的换行符所在行 const lastLineContent = linesInText[linesInText.length - 2] || ''; // 取文本最后一行(排除末尾换行) - const newColumn = lastLineContent.length; + const newColumn = lastLineContent.length + 1; // Monaco 列号从1开始,末尾位置长度需要加1 // 更新光标位置并聚焦 const newPosition = new this.monaco!.Position(lastLineOfInsert, newColumn); -- Gitee