Skip to content
Snippets Groups Projects
Commit f3b64fdd authored by Maxime Jacquemin's avatar Maxime Jacquemin
Browse files

[ivette] The selected function is displayed on top of the view

parent 10a1f6d0
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ export default function SourceCode() { ...@@ -87,7 +87,7 @@ export default function SourceCode() {
const errorMsg = () => { D.error(`Fail to load source code file ${file}`); }; const errorMsg = () => { D.error(`Fail to load source code file ${file}`); };
const onError = () => { if (file) errorMsg(); }; const onError = () => { if (file) errorMsg(); };
const setValue = (text: string) => buffer.setValue(text); const setValue = (text: string) => buffer.setValue(text);
const setCursor = () => buffer.forEach((cm) => cm.setCursor(line - 1)); const setCursor = () => buffer.setCursorOnTop(line);
const text = React.useMemo(() => readFile(file), [file]); const text = React.useMemo(() => readFile(file), [file]);
Dome.usePromise(text.then(setValue).then(setCursor).catch(onError)); Dome.usePromise(text.then(setValue).then(setCursor).catch(onError));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment