Merge pull request #23284 from overleaf/ae-scope-event-types
Improve scope event types GitOrigin-RevId: 5327c56a14244a2513748d3bcbac04413d104e12
This commit is contained in:
@@ -33,7 +33,7 @@ import { Update } from '@/features/history/services/types/update'
|
||||
import { useDebugDiffTracker } from '../hooks/use-debug-diff-tracker'
|
||||
import { useEditorContext } from '@/shared/context/editor-context'
|
||||
|
||||
interface GotoOffsetOptions {
|
||||
export interface GotoOffsetOptions {
|
||||
gotoOffset: number
|
||||
}
|
||||
|
||||
@@ -243,12 +243,7 @@ export const EditorManagerProvider: FC = ({ children }) => {
|
||||
|
||||
const jumpToLine = useCallback(
|
||||
(options: GotoLineOptions) => {
|
||||
goToLineEmitter(
|
||||
options.gotoLine,
|
||||
options.gotoColumn ?? 0,
|
||||
options.syncToPdf ?? false,
|
||||
options.selectionLength
|
||||
)
|
||||
goToLineEmitter(options)
|
||||
},
|
||||
[goToLineEmitter]
|
||||
)
|
||||
@@ -460,7 +455,7 @@ export const EditorManagerProvider: FC = ({ children }) => {
|
||||
}
|
||||
} else if (hasGotoOffset(options)) {
|
||||
window.setTimeout(() => {
|
||||
eventEmitter.emit('editor:gotoOffset', options.gotoOffset)
|
||||
eventEmitter.emit('editor:gotoOffset', options)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,11 @@ export const OutlineProvider: FC = ({ children }) => {
|
||||
const jumpToLine = useCallback(
|
||||
(lineNumber: number, syncToPdf: boolean) => {
|
||||
setIgnoreNextScroll(true)
|
||||
goToLineEmitter(lineNumber, 0, syncToPdf)
|
||||
goToLineEmitter({
|
||||
gotoLine: lineNumber,
|
||||
gotoColumn: 0,
|
||||
syncToPdf,
|
||||
})
|
||||
eventTracking.sendMB('outline-jump-to-line')
|
||||
},
|
||||
[goToLineEmitter]
|
||||
|
||||
Reference in New Issue
Block a user