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.

scnvim.sclang

  • on_init
  • on_exit
  • on_output

scnvim.help

  • on_open
  • on_select

scnvim.editor

  • on_highlight
  • on_send

scnvim.postwin

  • 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

new (fn)
Create a new action.

Parameters:

  • fn The default function to call.

Returns:

    The action.

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.
generated by LDoc 1.5.0 Last updated 2024-09-16 07:21:44