라이브 편집 커서 스크롤 추적 수정 v1.8.0

This commit is contained in:
2026-06-25 11:37:16 +09:00
parent a93780731c
commit c77cf1032b
8 changed files with 27 additions and 13 deletions

View File

@@ -638,13 +638,6 @@ const getOffsetForLineColumn = (lines, lineIndex, column) => {
return offset + Math.min(Math.max(column, 0), line.length)
}
/**
* 인접 편집 블록으로 포커스를 옮긴다.
* @param {number} direction - -1 이전, 1 다음
* @param {number} column - 유지할 열(column 모드)
* @param {'column'|'block-start'|'block-end'} [caretMode='column'] - 커서 배치
* @returns {void}
*/
/**
* ↑↓ 이동 대상 편집 요소 목록을 반환한다.
* @returns {HTMLElement[]}
@@ -668,6 +661,13 @@ const getNavigationElements = () => {
.sort((left, right) => Number(left.dataset.sourceLine) - Number(right.dataset.sourceLine))
}
/**
* 인접 편집 블록으로 포커스를 옮긴다.
* @param {number} direction - -1 이전, 1 다음
* @param {number} column - 유지할 열(column 모드)
* @param {'column'|'block-start'|'block-end'} [caretMode='column'] - 커서 배치
* @returns {void}
*/
const navigateToAdjacentBlock = (direction, column, caretMode = 'column') => {
if (!import.meta.client || props.sourceLine === null) {
return
@@ -731,6 +731,7 @@ const navigateToAdjacentBlock = (direction, column, caretMode = 'column') => {
const targetOffset = getOffsetForLineColumn(targetLines, targetLineIndex, targetColumn)
setEditableCaretOffset(target, targetOffset)
target.scrollIntoView({ block: 'nearest', inline: 'nearest' })
}
/**