Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Please consider avoiding global variables #22

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

Please consider avoiding global variables #22

litoj opened this issue Feb 1, 2024 · 1 comment

Comments

@litoj
Copy link

litoj 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants