Skip to content

Commit

Permalink
fix: make line prop works as expected (#530)
Browse files Browse the repository at this point in the history
Co-authored-by: winter <winter@192.168.1.3>
  • Loading branch information
dxsun97 and winter authored Oct 6, 2023
1 parent 3a76077 commit bc4b241
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ function Editor({

monacoRef.current.editor.setTheme(theme);

if (line !== undefined) {
editorRef.current.revealLine(line);
}

setIsEditorReady(true);
preventCreation.current = true;
}
Expand All @@ -182,6 +186,7 @@ function Editor({
overrideServices,
saveViewState,
theme,
line,
]);

useEffect(() => {
Expand Down

0 comments on commit bc4b241

Please sign in to comment.