From d5b435b520159a21bd957f75da3ddd3fd3fa8ea9 Mon Sep 17 00:00:00 2001 From: helcoume <56561334+helcoume@users.noreply.github.com> Date: Fri, 12 Sep 2025 12:13:32 +0200 Subject: [PATCH] fix(jump): correct jump to the end of an empty field Prevent the cursor from getting stuck on the current field when jumping to the end of an empty field. --- lua/csvview/jump.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/csvview/jump.lua b/lua/csvview/jump.lua index d999606..cb7f079 100644 --- a/lua/csvview/jump.lua +++ b/lua/csvview/jump.lua @@ -284,7 +284,8 @@ function M.field(bufnr, opts) anchored_col = field.start_col else anchored_lnum = field.end_row - anchored_col = field.end_col - 1 + local is_empty_field = field.start_row == field.end_row and field.start_col == field.end_col + anchored_col = field.end_col - (is_empty_field and 0 or 1) if anchored_col < 0 then anchored_col = 0 end