Skip to content

Commit

Permalink
fix: hard stop at EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-418 committed Nov 14, 2022
1 parent a21bef2 commit cbb9221
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lua/boole.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ for _, letter in ipairs(letters) do
end

-- Booleans
M.generate({'true', 'false'}, true)
M.generate({'yes', 'no' }, true)
M.generate({'on', 'off' }, true)
M.generate({'enable', 'disable' }, true)
M.generate({'true', 'false'}, true)
M.generate({'yes', 'no'}, true)
M.generate({'on', 'off'}, true)
M.generate({'enable', 'disable'}, true)
M.generate({'enabled', 'disabled'}, true)

-- Canonical hours
M.generate(
Expand Down Expand Up @@ -341,7 +342,7 @@ M.run = function(direction)
if last_position[1] < current_position[1] then
vim.api.nvim_win_set_cursor(0, start_position)
vim.cmd('normal! wb')
return tryMatch(current_position)
return false
end

-- Do we have a match?
Expand All @@ -352,11 +353,11 @@ M.run = function(direction)
if match then
-- Are we at the end of the line? If so, jump back.
if (current_column + 1) == vim.fn.strlen(line) then
vim.cmd('normal! b')
return vim.cmd('normal! b')
-- Are we on the first character of the word? If not, move there.
elseif cword:sub(1, 1) ~= line:sub(current_column + 1, current_column + 1) then
vim.cmd('normal! l')
tryMatch(current_position)
return tryMatch(current_position)
end
-- Replace the word and put the cursor on the beginning of replacement.
vim.cmd('normal! ciw' .. match)
Expand Down

0 comments on commit cbb9221

Please # to comment.