코드 블록 설정 패널 UI 정리
This commit is contained in:
@@ -986,29 +986,28 @@ const handleTextareaCompositionEnd = () => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const refreshCaretLogicalLine = () => {
|
||||
nextTick(() => {
|
||||
const textarea = textareaRef.value
|
||||
const textarea = textareaRef.value
|
||||
|
||||
if (!textarea) {
|
||||
return
|
||||
}
|
||||
if (!textarea) {
|
||||
return
|
||||
}
|
||||
|
||||
const value = markdownValue.value ?? ''
|
||||
const pos = Math.min(textarea.selectionStart, value.length)
|
||||
const lineIndex = value.slice(0, pos).split('\n').length - 1
|
||||
const value = markdownValue.value ?? ''
|
||||
const start = Math.min(textarea.selectionStart, value.length)
|
||||
const end = Math.min(textarea.selectionEnd, value.length)
|
||||
const lineIndex = value.slice(0, start).split('\n').length - 1
|
||||
|
||||
lastSelectionState.value = {
|
||||
start: Math.min(textarea.selectionStart, value.length),
|
||||
end: Math.min(textarea.selectionEnd, value.length)
|
||||
}
|
||||
activeLogicalLineIndex.value = Math.max(0, lineIndex)
|
||||
syncTextareaHeight()
|
||||
syncBlockPanelState()
|
||||
lastSelectionState.value = {
|
||||
start,
|
||||
end
|
||||
}
|
||||
activeLogicalLineIndex.value = Math.max(0, lineIndex)
|
||||
syncBlockPanelState()
|
||||
syncTextareaHeight()
|
||||
|
||||
if (activeMode.value === 'write' && document.activeElement === textarea) {
|
||||
syncWriteSlashState()
|
||||
}
|
||||
})
|
||||
if (activeMode.value === 'write' && document.activeElement === textarea) {
|
||||
nextTick(syncWriteSlashState)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user