Skip to content
Snippets Groups Projects
Commit 9f51636e authored by Loïc Correnson's avatar Loïc Correnson
Browse files

Merge branch 'feature/ivette/copy-marker-to-clipboard' into 'master'

[Ivette] ASTview: adds a contextual menu entry 'copy to clipboard'.

See merge request frama-c/frama-c!4135
parents 18fd2f4e 0c9b1199
No related branches found
No related tags found
No related merge requests found
...@@ -578,6 +578,11 @@ function createContextMenuHandler(): Editor.Extension { ...@@ -578,6 +578,11 @@ function createContextMenuHandler(): Editor.Extension {
const writes = 'Studia: select writes'; const writes = 'Studia: select writes';
items.push({ label: reads, enabled, onClick: () => onClick('Reads') }); items.push({ label: reads, enabled, onClick: () => onClick('Reads') });
items.push({ label: writes, enabled, onClick: () => onClick('Writes') }); items.push({ label: writes, enabled, onClick: () => onClick('Writes') });
const copy = (): void => {
const text = view.state.sliceDoc(node.from, node.to);
if (text !== '') navigator.clipboard.writeText(text);
};
items.push({ label: 'Copy to clipboard', onClick: copy });
if (items.length > 0) Dome.popupMenu(items); if (items.length > 0) Dome.popupMenu(items);
return; return;
} }
......
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