Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AnAngryRaven
Copy link
Contributor

Describe your changes

Removed the cast to an i32, then back to a usize as it caused an unintentional integer overflow when subtracting. Instead, amount is cast as a usize.

As this breaks negative number inputs, these are first checked for, and the ShiftMode flipped accordingly. The amount value is then set to its absolute value, ensuring correct behaviour regardless.

Issue ticket number and link

Checklist before requesting a review

  • Documentation was updated (i.e. due to changes in keybindings, commands, etc.) -- N/A
  • Changelog was updated with relevant user-facing changes (eg. not dependency updates,
    not performance improvements, etc.)

note this preserves behaviour of shifting by negative numbers in either direction

changelog also updated accordingly
Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks reasonable!

@hrkfdn hrkfdn merged commit 8e3e107 into hrkfdn:main Sep 12, 2025
6 checks passed
@AnAngryRaven AnAngryRaven deleted the 1705 branch September 18, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants