From 289942d1a551553f2d8b570ce81304e0546cb351 Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:31:40 +0000 Subject: [PATCH] Merge pull request #15799 from overleaf/td-ide-page-synctex-jump-to-code-line In React IDE page, jump to line when opening a document if specified by the options GitOrigin-RevId: ddcacee33779112f4d5383ef0b5520e378dc6eb6 --- .../js/features/ide-react/context/editor-manager-context.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx index 4fef0d0aa4..efb4787121 100644 --- a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx @@ -392,7 +392,9 @@ export const EditorManagerProvider: FC = ({ children }) => { new CustomEvent('doc:after-opened', { detail: isNewDoc }) ) if (hasGotoLine(options)) { - // In CM6, jump to the line again after a stored scroll position has been restored + window.setTimeout(() => jumpToLine(options)) + + // Jump to the line again after a stored scroll position has been restored if (isNewDoc) { window.addEventListener( 'editor:scroll-position-restored',