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

Please consider avoiding global variables #22

Open
JosefLitos opened this issue Feb 1, 2024 · 1 comment
Open

Please consider avoiding global variables #22

JosefLitos opened this issue Feb 1, 2024 · 1 comment

Comments

@JosefLitos
Copy link

JosefLitos commented Feb 1, 2024

It is one thing to write code considered as bad practise, but my reason is performance - any unnecessary uses of global variables throught all kinds of plugins add up and can cause unnecessary slowdown due to longer time to access globals like vim and other, actually often used globals.

The block https://github.com/windwp/nvim-autopairs/blob/masterrfer/lua/syntax-tree-surfer/init.lua#L329
seems unnecessary - at least a lazy load should be no problem - like an option for dot repeat if not a different way to enable dot repeat altogether.

@ziontee113
Copy link
Owner

The _G. global variables used in this project is to support dot repeat. PRs are welcomed if you have a better implementation 👍

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 a pull request may close this issue.

2 participants