refactor(editor): migrate to ProseMirror Mark-based ghost text system
- Replace overlay-based GhostTextOverlay.vue with ProseMirror Mark system - Add AI toggle button with enable/disable functionality - Implement new copilotPlugin.ts using copilotGhostMark for inline suggestions - Fix cursor position offset in prompt.py by moving first suffix char to prefix - Improve API error handling with abort signal support and debug logging - Update model configuration from gpt-oss:120b to gpt-oss:20b - Add button tooltips and improve editor styling - Remove deprecated inlineSuggestionPlugin.ts - Update README with new architecture diagram and feature documentation
This commit is contained in:
@@ -8,6 +8,12 @@ def build_prompt(prefix: str, suffix: str) -> str:
|
||||
"""
|
||||
MAX_CONTEXT_LINES = 30
|
||||
|
||||
# 修正:把suffix的第一个字符移到prefix末尾(解决光标位置偏差)
|
||||
if suffix:
|
||||
first_char = suffix[0]
|
||||
prefix = prefix + first_char
|
||||
suffix = suffix[1:]
|
||||
|
||||
prefix_lines = prefix.split('\n')
|
||||
suffix_lines = suffix.split('\n') if suffix else []
|
||||
|
||||
@@ -25,6 +31,7 @@ RULES:
|
||||
- Match existing style, tone, and terminology
|
||||
- Maintain logical flow
|
||||
- Write only the continuation, nothing else
|
||||
- IMPORTANT: Start continuation directly from ⟨CURSOR⟩ position
|
||||
|
||||
TEXT:
|
||||
{recent_prefix}⟨CURSOR⟩{recent_suffix}
|
||||
|
||||
Reference in New Issue
Block a user