Skip to content
Snippets Groups Projects
Commit 5ffaab78 authored by David Bühler's avatar David Bühler
Browse files

[ivette] When jumping to a function, resets the selected marker to null.

The ASTinfo component clears the buffer when the selected marker changes and
no data is provided (which happens when the marker is null).
parent 8cd45e7e
No related branches found
No related tags found
No related merge requests found
...@@ -23,15 +23,15 @@ const ASTinfo = () => { ...@@ -23,15 +23,15 @@ const ASTinfo = () => {
React.useEffect(() => { React.useEffect(() => {
buffer.clear(); buffer.clear();
if (data) { if (marker && data) {
buffer.printTextWithTags(data, { css: 'color: blue' }); buffer.printTextWithTags(data, { css: 'color: blue' });
} }
}, [buffer, data]); }, [marker, buffer, data]);
// Callbacks // Callbacks
function onSelection(name: string) { function onSelection(name: string) {
// For now, the only markers are functions. // For now, the only markers are functions.
setSelect({ function: name }); setSelect({ function: name, marker: null });
} }
// Component // Component
......
...@@ -105,7 +105,7 @@ const ASTview = () => { ...@@ -105,7 +105,7 @@ const ASTview = () => {
if (marker && marker.kind === 'function') { if (marker && marker.kind === 'function') {
const item1 = { const item1 = {
label: `Go to definition of ${marker.name}`, label: `Go to definition of ${marker.name}`,
onClick: () => setSelect({ function: marker.name }), onClick: () => setSelect({ function: marker.name, marker: null }),
}; };
Dome.popupMenu([item1]); Dome.popupMenu([item1]);
} }
......
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