mirror of
https://github.com/kristoferssolo/runner.nvim.git
synced 2025-10-21 19:50:34 +00:00
Add docs for set_handler function
This commit is contained in:
parent
f953f8e038
commit
5b4c96cb0b
@ -11,6 +11,19 @@ M.setup = function(options)
|
||||
config.setup(options)
|
||||
end
|
||||
|
||||
--- **Overrides** the handler for the specified filetype
|
||||
---
|
||||
--- Usage:
|
||||
--- ```lua
|
||||
--- local helpers = require('runner.handlers.helpers')
|
||||
--- require('runner').set_handler(
|
||||
--- 'lua',
|
||||
--- helpers.command_handler('luafile %'),
|
||||
--- )
|
||||
--- ```
|
||||
---
|
||||
--- @param filetype string The filetype on which to run the given handler
|
||||
--- @param handler function The handler to run when the current file matches the filetype
|
||||
M.set_handler = function(filetype, handler)
|
||||
M._handlers[filetype] = handler
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user