Skip to content

Commit

Permalink
Make toggle command to accept bang
Browse files Browse the repository at this point in the history
  • Loading branch information
monkoose committed Sep 11, 2024
1 parent a95bf10 commit 3e02a23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ NeoCodeium provides `:NeoCodeium` user command, which has some useful actions:
- `:NeoCodeium auth` - authenticates the user and saves the API token.
- `:NeoCodeium[!] disable` - disables completions. With the bang also stops the codeium server.
- `:NeoCodeium enable` - enables NeoCodeium completion.
- `:NeoCodeium toggle` - toggles NeoCodeium completion.
- `:NeoCodeium[!] toggle` - toggles NeoCodeium completion. Convey the bang to disable command.
- `:NeoCodeium disable_buffer` - disables NeoCodeium completion in the current buffer.
- `:NeoCodeium enable_buffer` - enables NeoCodeium completion in the current buffer.
- `:NeoCodeium toggle_buffer` - toggles NeoCodeium completion in the current buffer.
Expand Down
4 changes: 2 additions & 2 deletions lua/neocodeium/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ function M.enable()
end
end

function M.toggle()
function M.toggle(bang)
if options.enabled then
M.disable()
M.disable(bang)
else
M.enable()
end
Expand Down

0 comments on commit 3e02a23

Please sign in to comment.