Skip to content

Commit

Permalink
feat: hock -> hook (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
pogyomo authored Dec 30, 2024
1 parent dd3b280 commit 48cbfc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ vim.api.nvim_create_autocmd("User", {
- `mode_name?: string | fun(): string` Change the value `mode()` returns.
- `enter?: string | string[]` Keys to enter to this submode.
- `leave?: string | string[]` Keys to leave from this submode.
- `hock: table` Holds callbacks called on specific timing.
- `hook: table` Holds callbacks called on specific timing.
- `on_enter: fun()` Executed on same timing as `SubmodeEnterPost`.
- `on_leave: fun()` Executed on same timing as `SubmodeLeavePost`.
- `default?: function` Callback to register default mappings. Take a following value:
Expand Down
4 changes: 2 additions & 2 deletions lua/submode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function M.enter(name)
name = name,
},
})
opts.hock.on_enter()
opts.hook.on_enter()
end

---Leave from current submode.
Expand Down Expand Up @@ -318,7 +318,7 @@ function M.leave()
name = name,
},
})
opts.hock.on_leave()
opts.hook.on_leave()
end

return M
2 changes: 1 addition & 1 deletion lua/submode/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
---@field mode ShortenMode
---@field show_mode? boolean
---@field mode_name? string | fun():string
---@field hock? { on_enter: function, on_leave: function }
---@field hook? { on_enter: function, on_leave: function }
---@field enter? string | string[]
---@field leave? string | string[]
---@field default? fun(register: SubmodeDefaultMappingRegister)
Expand Down

0 comments on commit 48cbfc7

Please sign in to comment.