|
@@ -53,6 +53,7 @@ import { useHunspell } from '@/features/source-editor/hooks/use-hunspell'
|
|
|
import { Permissions } from '@/features/ide-react/types/permissions'
|
|
import { Permissions } from '@/features/ide-react/types/permissions'
|
|
|
import { useEditorManagerContext } from '@/features/ide-react/context/editor-manager-context'
|
|
import { useEditorManagerContext } from '@/features/ide-react/context/editor-manager-context'
|
|
|
import { useOnlineUsersContext } from '@/features/ide-react/context/online-users-context'
|
|
import { useOnlineUsersContext } from '@/features/ide-react/context/online-users-context'
|
|
|
|
|
+import { setBreadcrumbsEnabled } from '../extensions/breadcrumbs-panel'
|
|
|
|
|
|
|
|
function useCodeMirrorScope(view: EditorView) {
|
|
function useCodeMirrorScope(view: EditorView) {
|
|
|
const { fileTreeData } = useFileTreeData()
|
|
const { fileTreeData } = useFileTreeData()
|
|
@@ -82,6 +83,7 @@ function useCodeMirrorScope(view: EditorView) {
|
|
|
syntaxValidation,
|
|
syntaxValidation,
|
|
|
mathPreview,
|
|
mathPreview,
|
|
|
referencesSearchMode,
|
|
referencesSearchMode,
|
|
|
|
|
+ enableNewEditor,
|
|
|
} = userSettings
|
|
} = userSettings
|
|
|
|
|
|
|
|
const { onlineUserCursorHighlights } = useOnlineUsersContext()
|
|
const { onlineUserCursorHighlights } = useOnlineUsersContext()
|
|
@@ -151,6 +153,7 @@ function useCodeMirrorScope(view: EditorView) {
|
|
|
syntaxValidation,
|
|
syntaxValidation,
|
|
|
mathPreview,
|
|
mathPreview,
|
|
|
referencesSearchMode,
|
|
referencesSearchMode,
|
|
|
|
|
+ enableNewEditor,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const currentDocRef = useRef({
|
|
const currentDocRef = useRef({
|
|
@@ -433,6 +436,13 @@ function useCodeMirrorScope(view: EditorView) {
|
|
|
settingsRef.current.referencesSearchMode = referencesSearchMode
|
|
settingsRef.current.referencesSearchMode = referencesSearchMode
|
|
|
}, [referencesSearchMode])
|
|
}, [referencesSearchMode])
|
|
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ settingsRef.current.enableNewEditor = enableNewEditor
|
|
|
|
|
+ window.setTimeout(() => {
|
|
|
|
|
+ view.dispatch(setBreadcrumbsEnabled(enableNewEditor))
|
|
|
|
|
+ })
|
|
|
|
|
+ }, [view, enableNewEditor])
|
|
|
|
|
+
|
|
|
const emitSyncToPdf = useScopeEventEmitter('cursor:editor:syncToPdf')
|
|
const emitSyncToPdf = useScopeEventEmitter('cursor:editor:syncToPdf')
|
|
|
|
|
|
|
|
// select and scroll to position on editor:gotoLine event (from synctex)
|
|
// select and scroll to position on editor:gotoLine event (from synctex)
|