Skip to content

Commit

Permalink
fix: support reversed multiple selections
Browse files Browse the repository at this point in the history
  • Loading branch information
imjlk authored Oct 9, 2023
1 parent d4277a3 commit 1768c91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/object-explorer/explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ export const ObjectExplorer = ({ initialObjects, initialCursor }: Props): JSX.El
if (lastSelectedIdx === -1) {
addSelectedObject(object.path, objInfo);
} else {
for (let i = lastSelectedIdx; i <= objInfo.idx; i++) {
const start = Math.min(lastSelectedIdx, objInfo.idx);
const end = Math.max(lastSelectedIdx, objInfo.idx);
for (let i = start; i <= end; i++) {
const nextObj = rows[i];
if (nextObj) addSelectedObject(nextObj.original.path, { idx: i });
}
Expand Down

0 comments on commit 1768c91

Please sign in to comment.