슬래시 하이라이트 인덱스 보정 분리

This commit is contained in:
2026-07-27 11:49:05 +09:00
parent a39944b139
commit 5803e1927c
7 changed files with 38 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ import {
} from '../../lib/markdown-editor-media.js'
import {
addSlashSuppressedLine,
clampSlashHighlightedIndex,
filterSlashCommands,
getMediaPickerKindFromSlashAction,
getSlashCommandFocusTarget,
@@ -2567,9 +2568,7 @@ watch(liveSlashQuery, () => {
})
watch(visibleLiveSlashCommands, (commands) => {
if (liveSlashHighlightedIndex.value >= commands.length) {
liveSlashHighlightedIndex.value = Math.max(0, commands.length - 1)
}
liveSlashHighlightedIndex.value = clampSlashHighlightedIndex(liveSlashHighlightedIndex.value, commands.length)
updateLiveSlashMenuPosition()
})