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

fix: avoid global variable usage #426

Merged
merged 2 commits into from Feb 17, 2024
Merged

fix: avoid global variable usage #426

merged 2 commits into from Feb 17, 2024

Conversation

JosefLitos
Copy link
Contributor

fixes #425

@windwp
Copy link
Owner

windwp commented Feb 17, 2024

Thank

@windwp windwp merged commit 2e8a10c into windwp:master Feb 17, 2024
1 check passed
@zeertzjq
Copy link
Contributor

Hmm, this is a breaking change.

@JosefLitos
Copy link
Contributor Author

Hmm, I thought I checked everything. From what I've found, all uses were withing the plugin internals. That shouldn't affect the user because they don't have direct access (or at least, I believe, have no reason to use it directly). Is there something I can help with?

@zeertzjq
Copy link
Contributor

Well, I used v:lua.MPairs directly in my mappings. Replacing them with v:lua.require'nvim-autopairs' will work, although I just discovered a bug in Nvim that causes it to error sometimes.

@JosefLitos
Copy link
Contributor Author

JosefLitos commented Feb 18, 2024

You should be able to call it the same way I made the changes in the plugin - as a <Cmd> or a function callback. Though it is something that users using the global directly do have to change due to this PR.

@stancl
Copy link

stancl commented Feb 18, 2024

These changes seems to make neovim freeze when the plugin's behavior is triggered, see comments on 2e8a10c

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.

Do not use global variables (MPairs)
4 participants