编辑器资源本地化
This commit is contained in:
@@ -8,6 +8,8 @@ import type { editor as MonacoEditorNs } from "monaco-editor"
|
||||
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
import "@/lib/monaco-local"
|
||||
|
||||
const MonacoDiffEditor = dynamic(
|
||||
async () => {
|
||||
const mod = await import("@monaco-editor/react")
|
||||
@@ -171,6 +173,8 @@ export function DiffViewer({
|
||||
modified={modified}
|
||||
language={language}
|
||||
theme={editorTheme}
|
||||
keepCurrentOriginalModel
|
||||
keepCurrentModifiedModel
|
||||
beforeMount={defineMonacoThemes}
|
||||
onMount={handleEditorMount}
|
||||
loading={
|
||||
|
||||
@@ -71,6 +71,8 @@ interface HunkPreviewLine {
|
||||
marker: RowMarker
|
||||
}
|
||||
|
||||
import "@/lib/monaco-local"
|
||||
|
||||
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
||||
ssr: false,
|
||||
})
|
||||
|
||||
@@ -291,6 +291,8 @@ function setEditorHiddenAreas(
|
||||
hiddenAreaEditor.setHiddenAreas?.(ranges)
|
||||
}
|
||||
|
||||
import "@/lib/monaco-local"
|
||||
|
||||
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
||||
ssr: false,
|
||||
})
|
||||
|
||||
@@ -23,6 +23,8 @@ import {
|
||||
} from "./merge-diff"
|
||||
import { useSyncScroll } from "./use-sync-scroll"
|
||||
|
||||
import "@/lib/monaco-local"
|
||||
|
||||
const MonacoEditor = dynamic(
|
||||
async () => {
|
||||
const mod = await import("@monaco-editor/react")
|
||||
|
||||
Reference in New Issue
Block a user