Add Markdown visual editor support

GitOrigin-RevId: 4ec2ffb276c729a58f82ccb26ed571f4187a4178
This commit is contained in:
Domagoj Kriskovic
2026-06-04 08:06:04 +00:00
committed by Copybot
parent e38f4e18e4
commit 5cf1b43ce7
10 changed files with 45 additions and 9 deletions
@@ -63,7 +63,7 @@ import { useActiveOverallTheme } from '@/shared/hooks/use-active-overall-theme'
import { useEditorSelectionContext } from '@/shared/context/editor-selection-context'
import { useActiveEditorTheme } from '@/shared/hooks/use-active-editor-theme'
import { useFeatureFlag } from '@/shared/context/split-test-context'
import { isValidTeXFile } from '@/main/is-valid-tex-file'
import { isCmVisualEditorAvailable } from '../utils/visual-editor'
function useCodeMirrorScope(view: EditorView) {
const { fileTreeData } = useFileTreeData()
@@ -277,7 +277,8 @@ function useCodeMirrorScope(view: EditorView) {
const { previewByPath } = useFileTreePathContext()
const showVisual = visual && !!openDocName && isValidTeXFile(openDocName)
const showVisual =
visual && !!openDocName && isCmVisualEditorAvailable(openDocName)
const visualRef = useRef({
previewByPath,