Skip to content

Commit

Permalink
fix vim:E976 error when cursor is on a blob
Browse files Browse the repository at this point in the history
  • Loading branch information
sontungexpt committed Nov 17, 2023
1 parent 6e67d18 commit 9efc8cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/url-open/modules/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ M.highlight_cursor_url = function(user_opts)
local cursor_col = cursor_pos[2]
local line = api.nvim_get_current_line()

-- Fixes vim:E976 error when cursor is on a blob
if fn.type(line) == vim.v.t_blob then return end

handlers.foreach_url_in_line(user_opts, line, function(_, start_found, end_found)
M.delete_url_effect("URLOpenHighlightCursor")
if user_opts.open_only_when_cursor_on_url then
Expand Down

0 comments on commit 9efc8cb

Please sign in to comment.