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

Use internal property for directory suffix #256

Conversation

clemera
Copy link
Collaborator

@clemera clemera commented Dec 7, 2020

Using selectrum-candidate-display-suffix overrides any annotations or usages of that property from the calling side so I switched to use an internal property for the special purpose of displaying the directory slashes. See #255.

@minad
Copy link
Contributor

minad commented Dec 7, 2020

So you have both 'selectrum-candidate-display-suffix and 'selectrum--candidate-display-suffix now? Not that I am in any way familiar with the selectrum code base, but this looks like a typo to me. What about 'selectrum--internal-candidate-display-suffix and documenting the difference?

Does this solve the problems with the directories in #255?

@clemera
Copy link
Collaborator Author

clemera commented Dec 7, 2020

As it's only used in one it's not hard to figure out what it used for but I can add a comment. I will also rename it that's a good idea!

Does this solve the problems with the directories in #255?

Yes, it should

@clemera clemera merged commit 0c81bc8 into radian-software:master Dec 7, 2020
@minad
Copy link
Contributor

minad commented Dec 7, 2020

@clemera Thank you, works perfectly!

@clemera
Copy link
Collaborator Author

clemera commented Dec 8, 2020

I got rid of the internal property again in #258.

;; displaying slashes of directories in file
;; completions.
0 'selectrum--internal-candidate-display-suffix
candidate))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. This seems slightly unfortunate. It feels kind of similar to some of the things going on in Ivy/Counsel, where the public API isn't expressive enough to implement all the needed features, and so some of the Ivy functions have special cases to handle specific callers from Counsel. In an ideal world, we'd be able to support multiple suffixes natively in some way through the public API.

I don't know if that's actually achievable---maybe this is one of those cases where you just have to hack it, because the alternative is too inconvenient---but I thought I would call attention to it since I think we want to try to avoid this kind of thing suffusing the entire codebase, since then we'll end up in an Ivy/Counsel sort of situation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, hehe, I see you got rid of it in #262. That's what I get for being so behind on email!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy it could be removed because of the reasons you mentioned above, there where some refactoring issues after I switched but I hope these have all been sorted out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants