From 9efc8cbac49137e35904384a88523c58ab79b3bf Mon Sep 17 00:00:00 2001 From: Tran Vo Son Tung Date: Fri, 17 Nov 2023 07:14:36 +0700 Subject: [PATCH] fix vim:E976 error when cursor is on a blob --- lua/url-open/modules/highlight.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/url-open/modules/highlight.lua b/lua/url-open/modules/highlight.lua index c8013a3..a6040be 100644 --- a/lua/url-open/modules/highlight.lua +++ b/lua/url-open/modules/highlight.lua @@ -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