From 8afac388bb67ef3db23d002af3c91212709a225b Mon Sep 17 00:00:00 2001 From: AidanV <84053180+AidanV@users.noreply.github.com> Date: Mon, 28 Apr 2025 09:55:15 -0700 Subject: [PATCH] vim: Fix `'t'` motion to start of soft wrapped line (#29303) Closes #28853 Release Notes: - Fixes `'t'` motion going on top of character that is at the beginning of soft wrapped line instead of before --- crates/vim/src/motion.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/vim/src/motion.rs b/crates/vim/src/motion.rs index fcf1e07749c56274dbfeeba445ef1434fc893682..331d7897f6855b17d9e577840681358f54a4c64c 100644 --- a/crates/vim/src/motion.rs +++ b/crates/vim/src/motion.rs @@ -2401,6 +2401,10 @@ fn find_forward( if before && to.column() > 0 { *to.column_mut() -= 1; Some(map.clip_point(to, Bias::Left)) + } else if before && to.row().0 > 0 { + *to.row_mut() -= 1; + *to.column_mut() = map.line(to.row()).len() as u32; + Some(map.clip_point(to, Bias::Left)) } else { Some(to) }