라이브 인용 콜아웃 입력 보정
This commit is contained in:
@@ -103,6 +103,8 @@ const suppressBlurCommit = ref(false)
|
||||
const splitLock = ref(false)
|
||||
/** 조합 중 Enter 후 compositionend에서 분리할지 */
|
||||
const pendingSplitAfterComposition = ref(false)
|
||||
/** 조합 종료 직후 중복 Enter를 무시할 기준 시각 */
|
||||
const suppressComposedEnterUntil = ref(0)
|
||||
const showingRaw = ref(false)
|
||||
|
||||
/** @returns {string} Enter 동작 모드 */
|
||||
@@ -526,7 +528,7 @@ const navigateToAdjacentBlock = (direction, column, caretMode = 'column') => {
|
||||
const target = elements[currentIndex + direction]
|
||||
|
||||
if (!target) {
|
||||
if (resolvedEnterMode.value === 'multiline' && direction === 1) {
|
||||
if (['insert-below', 'multiline'].includes(resolvedEnterMode.value) && direction === 1) {
|
||||
emit('insert-below', buildInsertBelowPayload())
|
||||
}
|
||||
|
||||
@@ -771,9 +773,14 @@ const onKeydown = (event) => {
|
||||
&& props.sourceLine !== null
|
||||
&& !readEditorValue().trim()
|
||||
) {
|
||||
const lineContext = getCaretLineContext()
|
||||
const sourceLine = resolvedEnterMode.value === 'multiline'
|
||||
? props.sourceLine + lineContext.lineIndex
|
||||
: props.sourceLine
|
||||
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
emit('delete-line', props.sourceLine)
|
||||
emit('delete-line', sourceLine)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -863,6 +870,17 @@ const onKeydown = (event) => {
|
||||
|
||||
const enterMode = showingRaw.value ? 'insert-below' : resolvedEnterMode.value
|
||||
|
||||
if (
|
||||
event.key === 'Enter'
|
||||
&& !event.shiftKey
|
||||
&& suppressComposedEnterUntil.value
|
||||
&& Date.now() < suppressComposedEnterUntil.value
|
||||
) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
return
|
||||
}
|
||||
|
||||
if (event.key === 'Enter' && !event.shiftKey && parseSlashInput(readEditorValue())) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
@@ -880,6 +898,7 @@ const onKeydown = (event) => {
|
||||
|
||||
if (event.isComposing || event.keyCode === 229) {
|
||||
pendingSplitAfterComposition.value = true
|
||||
suppressComposedEnterUntil.value = Date.now() + 240
|
||||
return
|
||||
}
|
||||
|
||||
@@ -917,6 +936,7 @@ const onCompositionEnd = () => {
|
||||
}
|
||||
|
||||
pendingSplitAfterComposition.value = false
|
||||
suppressComposedEnterUntil.value = Date.now() + 240
|
||||
const enterMode = showingRaw.value ? 'insert-below' : resolvedEnterMode.value
|
||||
|
||||
if (enterMode !== 'split-paragraph' && enterMode !== 'insert-below') {
|
||||
|
||||
Reference in New Issue
Block a user