-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
Description
General info
- Version: 1.0.0-rc3
Issue
After reviewing the newest version of the code, the following conditional statement has an issue in the second case (line 921-922).
if (new_range_start_index >= old_range_start_index && old_range_end_index === new_range_end_index
|| new_range_end_index === old_range_end_index && old_range_end_index >= new_range_end_index) {
The second case new_range_end_index === old_range_end_index && old_range_end_index >= new_range_end_index equals comparison does not make sense . The intention of the case is to test for 'near top', to mirror the case of 'near bottom'. By mistakenly referring to the end-ranges in the equals comparison, it fails to be a 'near top' test, and instead sort of nullifies the second case.
Fix
The second case should instead be changed to new_range_start_index === old_range_start_index && old_range_end_index >= new_range_end_index