Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Fix null character line #371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/hop/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ local function add_virt_cur(ns)
local virt_col = cur_info[5] - 1
local cur_line = vim.api.nvim_get_current_line()

if vim.fn.type(cur_line) == vim.v.t_blob then
return {}
end

-- toggle cursorline off if currently set
local cursorline_info = vim.api.nvim_win_get_option(vim.api.nvim_get_current_win(), 'cursorline')
if cursorline_info == true then
Expand Down
5 changes: 5 additions & 0 deletions lua/hop/jump_target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ local function mark_jump_targets_line(buf_handle, win_handle, regex, line_contex
local jump_targets = {}
local end_index = nil


if vim.fn.type(line_context.line) == vim.v.t_blob then
return {}
end

if win_width ~= nil then
end_index = col_offset + win_width
else
Expand Down