Make cursor move to duplicated line when duplicating line up (#41004)

Closes #40919
Follow-up of #39610
Release Notes:
- When duplicating line up, fixed cursor to move to the duplicated line
79eff1fe05Tom Planche committed on 10/23/2025, 11:20:16 PM· committed by GitHubparentaf0d2ad