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

[ivette] Allows a multiple selection of 0 elements.

parent e07cc6b3
No related branches found
No related tags found
No related merge requests found
...@@ -648,10 +648,10 @@ function reducer(s: Selection, action: SelectionActions): Selection { ...@@ -648,10 +648,10 @@ function reducer(s: Selection, action: SelectionActions): Selection {
return selectLocation(s, action.location); return selectLocation(s, action.location);
} }
if (isMultipleSelect(action)) { if (isMultipleSelect(action)) {
if (action.locations.length === 0)
return s;
const index = action.index > 0 ? action.index : 0; const index = action.index > 0 ? action.index : 0;
const selection = selectLocation(s, action.locations[index]); const selection =
action.locations.length === 0 ? s :
selectLocation(s, action.locations[index]);
return { return {
...selection, ...selection,
multiple: { multiple: {
......
...@@ -87,15 +87,16 @@ async function studia(marker: string, info: markerInfoData, kind: access) { ...@@ -87,15 +87,16 @@ async function studia(marker: string, info: markerInfoData, kind: access) {
const request = kind === 'Reads' ? getReadsLval : getWritesLval; const request = kind === 'Reads' ? getReadsLval : getWritesLval;
const data = await Server.send(request, marker); const data = await Server.send(request, marker);
const locations = data.direct.map(([f, m]) => ({ function: f, marker: m })); const locations = data.direct.map(([f, m]) => ({ function: f, marker: m }));
const lval = info.name;
if (locations.length > 0) { if (locations.length > 0) {
const lval = info.name;
const name = `${kind} of ${lval}`; const name = `${kind} of ${lval}`;
const title = `List of statements ${ const title = `List of statements ${
(kind === 'Reads') ? 'accessing' : 'modifying' (kind === 'Reads') ? 'accessing' : 'modifying'
} the memory location pointed by ${lval}.`; } the memory location pointed by ${lval}.`;
return { name, title, locations, index: 0 }; return { name, title, locations, index: 0 };
} }
return 'MULTIPLE_CLEAR'; const name = `No ${kind.toLowerCase()} of ${lval}`;
return { name, title: '', locations: [], index: 0 };
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
......
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