feat: complete last changes to add hooks

pull/560/head
Emanuel 1 year ago committed by Arijit Basu
parent d6e33e68e3
commit 105e770f58

@ -53,8 +53,6 @@ Renders the first column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_1
Renders the second column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_2
Renders the third column in the table
@ -115,5 +113,21 @@ return {
{ LogSuccess = "Changed focus" },
{ CallLuaSilently = "custom.some_plugin_with_hooks.on_focus_change" },
}
-- Add messages to send when the mode is switched.
--
-- Type: list of [Message](https://xplr.dev/en/message#message)s
on_mode_switch = {
{ LogSuccess = "Switched mode" },
{ CallLuaSilently = "custom.some_plugin_with_hooks.on_mode_switch" },
}
-- Add messages to send when the layout is switched
--
-- Type: list of [Message](https://xplr.dev/en/message#message)s
on_layout_switch = {
{ LogSuccess = "Switched layout" },
{ CallLuaSilently = "custom.some_plugin_with_hooks.on_layout_switch" },
}
}
```

@ -382,7 +382,7 @@ impl App {
self
}
pub fn handle_batch_external_msgs(self, msgs: Vec<ExternalMsg>) -> Result<Self> {
pub fn handle_batch_external_msgs(mut self, msgs: Vec<ExternalMsg>) -> Result<Self> {
for task in msgs
.into_iter()
.map(|msg| Task::new(MsgIn::External(msg), None))

@ -2704,8 +2704,21 @@ xplr.fn.custom = {}
-- { CallLuaSilently = "custom.some_plugin_with_hooks.on_focus_change" },
-- }
--
-- ...
-- }
-- -- Add messages to send when the mode is switched.
-- --
-- -- Type: list of [Message](https://xplr.dev/en/message#message)s
-- on_mode_switch = {
-- { LogSuccess = "Switched mode" },
-- { CallLuaSilently = "custom.some_plugin_with_hooks.on_mode_switch" },
-- }
--
-- -- Add messages to send when the layout is switched
-- --
-- -- Type: list of [Message](https://xplr.dev/en/message#message)s
-- on_layout_switch = {
-- { LogSuccess = "Switched layout" },
-- { CallLuaSilently = "custom.some_plugin_with_hooks.on_layout_switch" },
-- }
-- ```
return {

Loading…
Cancel
Save