diff --git a/doc/persisted.nvim.txt b/doc/persisted.nvim.txt index 3ba97c1..c75aa11 100644 --- a/doc/persisted.nvim.txt +++ b/doc/persisted.nvim.txt @@ -349,9 +349,11 @@ autocommand can be created to hook into the `PersistedSavePre` event: }) < -Session data is also made available to the callback: +Session data is also made available to the callbacks: >lua + local group = vim.api.nvim_create_augroup("PersistedHooks", {}) + vim.api.nvim_create_autocmd({ "User" }, { pattern = "PersistedTelescopeLoadPre", group = group, @@ -361,6 +363,11 @@ Session data is also made available to the callback: }) < +The session data available differs depending on the events that are hooked +into. For non-telescope events, only the session `name` is available (via +`session.data.name`). However for telescope events, the `branch`, `name`, +`file_path` and `dir_path` are available. + Finaly, if you’re using the excellent Legendary.nvim plugin, consider the following snippet format: