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

Defer loading some modules #355

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

przepompownia
Copy link

to prevent from loading them on startup.

@kylechui kylechui merged commit dca2e99 into kylechui:main Oct 28, 2024
4 checks passed
@kylechui
Copy link
Owner

Thanks for the changes!

@przepompownia przepompownia deleted the defer-loading-modules branch October 28, 2024 17:50
@przepompownia
Copy link
Author

przepompownia commented Oct 28, 2024

Thank you too.

Please consider similar change in

local buffer = require("nvim-surround.buffer")
local nvim_surround = require("nvim-surround")
vim.on_key(function(key)
if key == "." and not nvim_surround.pending_surround then
nvim_surround.normal_curpos = buffer.get_curpos()
end
end)

I didn't move those requirements into on_key callback because I haven't checked whether it can significantly affect performance.

@kylechui
Copy link
Owner

I think that it is probably fine to leave those imports as-is, since by the time the user has called setup it is probably fine to import the rest of the modules. Also I don't think nvim-surround does a lot of computation up-front anyways, so I'll only consider changing it if someone demonstrates (i.e. measures) it to be an issue.

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.

2 participants