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

Make plugins in ~/.config/micro/plug dir override built-in plugins #3031

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Nov 19, 2023

If ~/.config/micro/plug directory contains a plugin with the same name as a built-in plugin, the expected behavior is that the user-defined plugin in ~/.config/micro/plug is loaded instead of the built-in one.

Whereas the existing behavior is that the built-in plugin is used instead of the user-defined one. Even worse, it is buggy: in this case the plugin is registered twice, so its callbacks are executed twice (e.g. with the autoclose plugin, a bracket is autoclosed with two closing brackets instead of one).

Fix this by ensuring that if a plugin with the same name exists in the ~/.config/micro/plug directory, the built-in one is ignored.

Fixes #3029

If ~/.config/micro/plug directory contains a plugin with the same name
as a built-in plugin, the expected behavior is that the user-defined
plugin in ~/.config/micro/plug is loaded instead of the built-in one.

Whereas the existing behavior is that the built-in plugin is used
instead of the user-defined one. Even worse, it is buggy: in this case
the plugin is registered twice, so its callbacks are executed twice
(e.g. with the autoclose plugin, a bracket is autoclosed with two
closing brackets instead of one).

Fix this by ensuring that if a plugin with the same name exists in the
~/.config/micro/plug directory, the built-in one is ignored.

Fixes zyedidia#3029
@JoeKar
Copy link
Collaborator

JoeKar commented Dec 1, 2023

With #3066 we can do the same thing for the rest of the runtime files with the same approach. 😉

@zyedidia zyedidia merged commit 59dda01 into zyedidia:master Jan 17, 2024
3 checks passed
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.

How to replace default (embedded) plugins?
3 participants