Shun Miyazawa 11 месяцев назад
Родитель
Сommit
01237495f3
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      apps/app/src/features/openai/client/services/editor-assistant.ts

+ 4 - 4
apps/app/src/features/openai/client/services/editor-assistant.ts

@@ -71,22 +71,22 @@ const insertTextAtLine = (yText: YText, lineNumber: number, textToInsert: string
 
 const appendTextLastLine = (yText: YText, textToAppend: string) => {
   // First, get the current content of the Y.Text
-  const currentContent = yText.toString();
+  const content = yText.toString();
 
   // Find the position of the last line
   let insertPosition: number;
 
-  if (currentContent.length === 0) {
+  if (content.length === 0) {
     // If the document is empty, insert at position 0
     insertPosition = 0;
   }
   else {
     // Otherwise, find the end of the document
-    insertPosition = currentContent.length;
+    insertPosition = content.length;
 
     // If we want to ensure we're at the end of a line (not starting a new one)
     // we can check if the last character is already a newline
-    const endsWithNewline = currentContent.endsWith('\n');
+    const endsWithNewline = content.endsWith('\n');
 
     // If you want to append to the existing last line (not create a new one)
     // and the document ends with a newline, move back one character