diff --git a/ivette/src/frama-c/states.ts b/ivette/src/frama-c/states.ts index 01ff09edb8a3ee3f62550d267015abf3e6e2bdcd..8f3e5342f93890a9061506b0b762196b290e0a67 100644 --- a/ivette/src/frama-c/states.ts +++ b/ivette/src/frama-c/states.ts @@ -38,6 +38,7 @@ import { Client, useModel } from 'dome/table/models'; import { CompactModel } from 'dome/table/arrays'; import * as Ast from 'frama-c/kernel/api/ast'; import * as Server from './server'; +import * as Status from 'frama-c/kernel/Status'; // -------------------------------------------------------------------------- // --- Pretty Printing (Browser Console) @@ -789,6 +790,14 @@ export function useSelection(): [Selection, (a: SelectionActions) => void] { const [current, setCurrent] = useGlobalState(GlobalSelection); const callback = React.useCallback((action) => { setCurrent(reducer(current, action)); + if (isMultipleSelect(action)) { + const l = action.locations.length; + const markers = + (l > 1) ? `${l} markers selected, listed in the 'Locations' panel` : + (l === 1) ? `1 marker selected` : `no markers selected`; + const text = `${action.name}: ${markers}`; + Status.setMessage({ text, title: action.title, kind: 'success' }); + } }, [current, setCurrent]); return [current, callback]; }