Skip to content
Open
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/nvim-cursorline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ local DEFAULT_OPTIONS = {
local function matchadd()
local column = a.nvim_win_get_cursor(0)[2]
local line = a.nvim_get_current_line()
if fn.type(line) == vim.v.t_blob then
return
end
local cursorword = fn.matchstr(line:sub(1, column + 1), [[\k*$]])
.. fn.matchstr(line:sub(column + 1), [[^\k*]]):sub(2)

Expand All @@ -37,6 +40,7 @@ local function matchadd()
end
if
cursorword == ""
or cursorword == "~"
or #cursorword > 100
or #cursorword < M.options.cursorword.min_length
or string.find(cursorword, "[\192-\255]+") ~= nil
Expand Down