@lkcampbell I think it's rare that someone would use this command with selections outside of the viewport, so I think that is a good solution.

If you really want to split hairs, there's the case where there's multiple selections and there's 2 or more inside the viewport, but at least 1 outside the viewport. If you instead determine "first selection in viewport" and "last selection in viewport" you would also cover that case.

cc: @njx