From d7747ddd6c81b1bc38d9f736481cded5e294b5e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Feb 2023 11:14:44 +0000 Subject: [PATCH] chore(build): auto-generate vimdoc --- doc/persisted.nvim.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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: