pub fn shift_click_range(anchor: Option<usize>, clicked: usize) -> Vec<usize>Expand description
Compute a shift-click range selection.
Given an optional anchor index (from the last non-shift click) and the
currently clicked index, returns an ascending Vec<usize> covering
[min(anchor, clicked)..=max(anchor, clicked)]. If anchor is None
the clicked index is used as both endpoints, yielding a single-element vec.
This is the shared logic behind shift-click range selection in the commit log, diff file list, and staging area — call it instead of duplicating the anchor + ascending_range pattern.