Skip to content

Commit c12cbf8

Browse files
authored
Merge pull request #1 from yanshay/fix-cursor-on-empty-line
fix issues when cursor on empty line (hadronized#351)
2 parents 90db1b2 + f095a9e commit c12cbf8

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)