Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit f095a9e

Browse files
committed
fix issues when cursor on empty line (hadronized#351)
1 parent 90db1b2 commit f095a9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/hop/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ local function set_unmatched_lines(buf_handle, hl_ns, top_line, bottom_line, cur
120120
local current_width = vim.fn.strdisplaywidth(current_line)
121121

122122
if end_col > current_width then
123-
end_col = current_width - 1
123+
end_col = current_width
124124
end
125125

126126
extmark_options.end_col = end_col
127127
end
128128

129-
vim.api.nvim_buf_set_extmark(buf_handle, hl_ns, start_line, start_col,
129+
vim.api.nvim_buf_set_extmark(buf_handle, hl_ns, start_line, start_col - 1,
130130
extmark_options)
131131
end
132132

0 commit comments

Comments
 (0)