Skip to content

Commit

Permalink
fix: remove extra space when the cursor is mid-word
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Dec 29, 2023
1 parent a6709ff commit 6dd0c62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/precognition/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ local function on_cursor_hold()
local line_end = line_len

local motion_w = next_word_boundary(after_cursor, 0)

if motion_w <= 1 then
motion_w = next_word_boundary(after_cursor, math.max(0, motion_w)) - 1
motion_w = next_word_boundary(after_cursor, math.max(0, motion_w)) - motion_w
else
motion_w = motion_w - 1
end

local virt_line = {}
Expand Down

0 comments on commit 6dd0c62

Please sign in to comment.