증상
Ctrl/Cmd + ↓ (문서 끝, moveToDocumentEnd) 영역 영역 다중 구역 문서 영역 영역 cursor rect 미발견 오류 발생.
재현 절차
- 다중 구역 문서 (예:
samples/aift.hwp — 3 구역) 열기
Ctrl/Cmd + ↓ 입력
- 결과: 콘솔 영역 영역 다음 오류 발생, 커서 위치 미이동
cursor.ts:699 [CursorState] updateRect 실패 → rect=null pos=(0,111,0) cell=(undefined,undefined,undefined,undefined): 렌더링 오류: 커서 위치를 찾을 수 없습니다: sec=0, para=111, offset=0
본 환경 점검 결과
본질 진단 — 단일 구역 가정 하드코드
rhwp-studio/src/engine/cursor.ts::moveToDocumentEnd:
moveToDocumentEnd(): void {
this.preferredX = null;
try {
const sec = 0; // 현재 단일 구역 가정 ← 결함
const paraCount = this.wasm.getParagraphCount(sec);
if (paraCount > 0) {
const lastPara = paraCount - 1;
const paraLen = this.wasm.getParagraphLength(sec, lastPara);
this.position = { sectionIndex: sec, paragraphIndex: lastPara, charOffset: paraLen };
}
...
}
}
moveToDocumentStart 영역 영역 동일 패턴 — sectionIndex: 0 하드코드.
본 환경 영향
aift.hwp (3 구역) 영역 영역:
- 구역 0 영역 영역 paragraphCount 영역 영역 가정 영역 영역
- 마지막 구역 영역 영역 lastPara 영역 영역 무관 영역 영역
sec=0, para=111, offset=0 영역 영역 잘못된 위치 영역 영역 cursor rect 미발견
처리 방향 (제안)
moveToDocumentStart
sectionIndex: 0, paragraphIndex: 0, charOffset: 0 — 정합 (첫 구역 첫 문단 영역 영역 항상 정합)
moveToDocumentEnd
getSectionCount() (또는 wasm.sectionCount) 영역 영역 마지막 구역 인덱스 도출
- 마지막 구역 영역 영역
lastPara = getParagraphCount(lastSec) - 1
paraLen = getParagraphLength(lastSec, lastPara)
영향 범위
관련
증상
Ctrl/Cmd + ↓(문서 끝,moveToDocumentEnd) 영역 영역 다중 구역 문서 영역 영역 cursor rect 미발견 오류 발생.재현 절차
samples/aift.hwp— 3 구역) 열기Ctrl/Cmd + ↓입력본 환경 점검 결과
본질 진단 — 단일 구역 가정 하드코드
rhwp-studio/src/engine/cursor.ts::moveToDocumentEnd:moveToDocumentStart영역 영역 동일 패턴 —sectionIndex: 0하드코드.본 환경 영향
aift.hwp (3 구역) 영역 영역:
sec=0, para=111, offset=0영역 영역 잘못된 위치 영역 영역 cursor rect 미발견처리 방향 (제안)
moveToDocumentStart
sectionIndex: 0, paragraphIndex: 0, charOffset: 0— 정합 (첫 구역 첫 문단 영역 영역 항상 정합)moveToDocumentEnd
getSectionCount()(또는wasm.sectionCount) 영역 영역 마지막 구역 인덱스 도출lastPara = getParagraphCount(lastSec) - 1paraLen = getParagraphLength(lastSec, lastPara)영향 범위
Ctrl/Cmd + ↓(PR Task #260: Ctrl/Cmd+Arrow 커서 이동 — 줄/문서 시작·끝 #746 영역 영역 추가)Ctrl + End(기존 동작 영역 영역 — 본 결함 영역 영역 동일 함수 영역 영역 호출 영역 영역 다중 구역 문서 영역 영역 동일 결함 영역 영역)관련
Ctrl/Cmd + ↓추가 — 본 결함 영역 영역 노출cursor.ts::moveToDocumentEnd영역 영역 단일 구역 가정 결함 (오랜 기간 영역 영역 잠재 결함)