Support controlled multi-selection and visible ranges in Tree
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
/** Range follows displayed rows only; folded/filtered-out branches cannot leak in. */
|
||||
export function treeSelectionRange(rows:readonly string[],anchor:string|null,target:string):string[]{
|
||||
const a=rows.indexOf(anchor??target),b=rows.indexOf(target);
|
||||
return a<0||b<0?[target]:rows.slice(Math.min(a,b),Math.max(a,b)+1);
|
||||
}
|
||||
Reference in New Issue
Block a user