|
@@ -96,7 +96,7 @@ export type CompileContext = {
|
|
|
stopCompile: () => void
|
|
stopCompile: () => void
|
|
|
setChangedAt: (value: any) => void
|
|
setChangedAt: (value: any) => void
|
|
|
clearCache: () => void
|
|
clearCache: () => void
|
|
|
- syncToEntry: (value: any) => void
|
|
|
|
|
|
|
+ syncToEntry: (value: any, keepCurrentView?: boolean) => void
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const LocalCompileContext = createContext<CompileContext | undefined>(
|
|
export const LocalCompileContext = createContext<CompileContext | undefined>(
|
|
@@ -573,13 +573,14 @@ export const LocalCompileProvider: FC = ({ children }) => {
|
|
|
}, [compiler])
|
|
}, [compiler])
|
|
|
|
|
|
|
|
const syncToEntry = useCallback(
|
|
const syncToEntry = useCallback(
|
|
|
- entry => {
|
|
|
|
|
|
|
+ (entry, keepCurrentView = false) => {
|
|
|
const result = findEntityByPath(entry.file)
|
|
const result = findEntityByPath(entry.file)
|
|
|
|
|
|
|
|
if (result && result.type === 'doc') {
|
|
if (result && result.type === 'doc') {
|
|
|
openDocId(result.entity._id, {
|
|
openDocId(result.entity._id, {
|
|
|
gotoLine: entry.line ?? undefined,
|
|
gotoLine: entry.line ?? undefined,
|
|
|
gotoColumn: entry.column ?? undefined,
|
|
gotoColumn: entry.column ?? undefined,
|
|
|
|
|
+ keepCurrentView,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|