diff --git a/lua/precognition/horizontal_motions.lua b/lua/precognition/horizontal_motions.lua index cde6aa4..9b75318 100644 --- a/lua/precognition/horizontal_motions.lua +++ b/lua/precognition/horizontal_motions.lua @@ -132,11 +132,7 @@ function M.prev_word_boundary(str, cursorcol, linelen, big_word) while utils.char_class(char, big_word) == c_class and offset >= 0 do offset = offset - 1 char = vim.fn.strcharpart(str, offset - 1, 1) - if char == "" then - -- Gone outside the line boundary, so break. - break - end - --if remaining string is whitespace, return nil_wrap + --if remaining string is whitespace, return 0 local remaining = string.sub(str, offset) if remaining:match("^%s*$") and #remaining > 0 then return 0 diff --git a/tests/precognition/char_spec.lua b/tests/precognition/char_spec.lua index 88f1b86..b1bbe36 100644 --- a/tests/precognition/char_spec.lua +++ b/tests/precognition/char_spec.lua @@ -9,6 +9,7 @@ describe("static classes", function() eq(cc.other, 1) eq(cc.word, 2) eq(cc.emoji, 3) + eq(cc.UNKNOWN, -1) end) end)