Skip to content

Commit

Permalink
feat: load SessionLens manually via user command (ayamir#745)
Browse files Browse the repository at this point in the history
* feat: disable session_lens load_on_setup, create command for search_session.

* perf: setup_session_lens only it not loaded.

* perf: update command name and side note.

---------

Co-authored-by: Jint-lzxy <[email protected]>
  • Loading branch information
2 people authored and bleedingfight committed Jun 22, 2023
1 parent d54e61d commit 3c9d5e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lua/modules/configs/editor/auto-session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,18 @@ return function()
auto_save_enabled = true,
auto_restore_enabled = true,
auto_session_suppress_dirs = nil,
session_lens = {
-- If `load_on_setup` is set to false, please use `SessionLensToggle` to manually load this add-on.
load_on_setup = false,
theme_conf = { border = true },
previewer = false,
},
})

vim.api.nvim_create_user_command("SessionLensToggle", function()
if not package.loaded["auto-session.session-lens"] then
require("auto-session").setup_session_lens()
end
require("auto-session.session-lens").search_session()
end, { nargs = 0 })
end

0 comments on commit 3c9d5e1

Please sign in to comment.