Lines Matching refs:selection
14 const selection = DWgetSelection(area);
20 // we ignore any selection and only use cursor position
21 selection.end = selection.start;
24 const start = area.value.lastIndexOf(open, selection.start);
25 const end = area.value.indexOf(close, selection.end);
28 const prev = area.value.lastIndexOf(close, selection.start - close.length);
29 const next = area.value.indexOf(open, selection.start + open.length);
32 if (start < min) return selection;
33 if (prev > -1 && prev > min && start < prev) return selection;
34 if (end > max) return selection;
35 if (next > -1 && next < end && end > next) return selection;
37 // still here? we are inside a boundary, new selection
38 selection.start = area.value.indexOf('>', start) + 1;
39 selection.end = end;
40 DWsetSelection(selection);
41 return selection;
50 const selection = selectDiagram(area);
52 const origSvg = area.value.substring(selection.start, selection.end);
59 area.value = area.value.substring(0, selection.start) +
61 area.value.substring(selection.end, area.value.length);