Module scnvim.action
Define actions.
An action defines an object that can be overriden by the user or by an extension.
Actions overview
See the corresponding module for detailed documentation.
- on_init
- on_exit
- on_output
- on_open
- on_select
- on_highlight
- on_send
- on_open
Functions
new (fn) | Create a new action. |
Class action
action:replace (fn) | Replace the default function. |
action:restore () | Restore the default function. |
action:append (fn) | Append a function. |
action:remove (id) | Remove an appended action. |
Functions
Class action
Methods
- action:replace (fn)
-
Replace the default function.
If several extension replace the same function then "last one wins".
Consider using action:append if your extensions doesn't need to replace the
default behaviour.
Parameters:
- fn The replacement function. The signature and return values must match the function to be replaced.
- action:restore ()
- Restore the default function.
- action:append (fn)
-
Append a function.
The appended function will run after the default function and will receive
the same input arguments. There can be several appended functions and they
will be executed in the order they were appended.
Parameters:
- fn The function to append.
Returns:
-
An integer ID. Use this ID if you need to remove the appended action.
- action:remove (id)
-
Remove an appended action.
Parameters:
- id ID of the action to remove.