Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load SessionLens manually via user command #745

Merged
merged 3 commits into from
May 16, 2023

Conversation

ayamir
Copy link
Owner

@ayamir ayamir commented May 16, 2023

@ayamir ayamir linked an issue May 16, 2023 that may be closed by this pull request
@ayamir
Copy link
Owner Author

ayamir commented May 16, 2023

A more reasonable way is judge if setuped when execute SessionLenShow but I have not idea to get the condition about it. Maybe better solution is providing similar command in upstream itself.

Copy link
Collaborator

@Jint-lzxy Jint-lzxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hesitant to merge this PR into main b/c we have already set auto-session to load-on-demand. Perhaps @Saafo can add this to his/her custom config 👍

A more reasonable way is judge if setuped

We have package.loaded :)

@Saafo
Copy link
Contributor

Saafo commented May 16, 2023

Perhaps @Saafo can add this to his/her custom config 👍

Both are fine to me!

@ayamir
Copy link
Owner Author

ayamir commented May 16, 2023

We have package.loaded :)

Seems I can't set it like below because the setup status of session_lens have no direct relation of whether telescope loaded or not.

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

@Jint-lzxy
Copy link
Collaborator

Seems I can't set it like below because the setup status of session_lens have no direct relation of whether telescope loaded or not.

We could check auto-session.session-lens instead ;)

@ayamir
Copy link
Owner Author

ayamir commented May 16, 2023

I tend to merge it into main for convenience and this solution is acceptable for users who use this plugin's functionality.

Copy link
Collaborator

@Jint-lzxy Jint-lzxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted phrasing 👍

lua/modules/configs/editor/auto-session.lua Outdated Show resolved Hide resolved
lua/modules/configs/editor/auto-session.lua Outdated Show resolved Hide resolved
@ayamir ayamir requested a review from Jint-lzxy May 16, 2023 14:38
@Jint-lzxy Jint-lzxy changed the title feat: disable session_lens load_on_setup, create command for search_session. feat: load SessionLens manually via user command May 16, 2023
@Jint-lzxy Jint-lzxy merged commit 351549c into main May 16, 2023
@Jint-lzxy Jint-lzxy deleted the feat/autosession-len branch May 16, 2023 14:49
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request May 16, 2023
* 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]>
boomker pushed a commit to boomker/uvcode-nvim that referenced this pull request May 24, 2023
* 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]>
(cherry picked from commit 351549c)
bleedingfight pushed a commit to bleedingfight/nvimdots that referenced this pull request Jun 22, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt to lazy load session_lens of auto-session
3 participants