feat: more sophisticated method to get copilot path#78
Merged
zbirenbaum merged 3 commits intozbirenbaum:masterfrom Nov 13, 2022
Merged
feat: more sophisticated method to get copilot path#78zbirenbaum merged 3 commits intozbirenbaum:masterfrom
zbirenbaum merged 3 commits intozbirenbaum:masterfrom
Conversation
Owner
|
I think this was proposed a while back, but I wasn't a huge fan of using debug functions as part of the plugin and tried to find another way. Unfortunately the way I came up with broke under a variety of circumstances so it was reverted. Since debug is probably the only way of doing this, I guess it might make sense. What do you think @MunifTanjim? |
Collaborator
|
Was |
Owner
I can't remember exactly but this seems to work great. I'll request it as a change. |
zbirenbaum
reviewed
Nov 10, 2022
838c06d to
2a9a182
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't rely on a fixed
plugin_manager_pathto find the plugin base path. Not only does that require changing an option depending on what plugin manager the user uses, but it also makes it incompatible with some plugin managers (i.e Nix, which doesn't store plugins under their literal name).This PR uses
debug.getinfo(1).source:sub(2)to find the current lua file and traverses to the base directory from there. This is much more versatile and portable.