Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: minor adjustments
Browse files Browse the repository at this point in the history
tris203 committed Jun 1, 2024
1 parent a373c38 commit a59896b
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lua/precognition/horizontal_motions.lua
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/precognition/char_spec.lua
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a59896b

Please sign in to comment.