Skip to content

[completion] Fix cider-enable-cider-completion-style #3800

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

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

alexander-yakushev
Copy link
Member

It being interactive works strangely with the newly added optional argument I've added.

@alexander-yakushev alexander-yakushev force-pushed the enable-completion-style-non-interactive branch from 725dff7 to b97f179 Compare March 31, 2025 11:51
@alexander-yakushev alexander-yakushev changed the title [completion] Make cider-enable-cider-completion-style non-interactive [completion] Fix cider-enable-cider-completion-style Mar 31, 2025
@alexander-yakushev alexander-yakushev merged commit d35611e into master Mar 31, 2025
18 checks passed
@alexander-yakushev alexander-yakushev deleted the enable-completion-style-non-interactive branch March 31, 2025 12:00
@@ -290,7 +290,7 @@ This style supports non-prefix completion candidates returned by the
completion backend. Only affects the `cider' completion category. If ARG
is `1' or nil, enables the custom completion style; if `-1', disables it."
(interactive)
(if (= arg -1)
(if (eq arg -1)
Copy link
Member

Choose a reason for hiding this comment

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

Seem weird a bit, as eq is supposed to check if you're comparing something with itself (mostly for symbols).

Copy link
Member

Choose a reason for hiding this comment

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

There's #3798, so it might be good to make some explicit nil check for the case with no argument passed.

Copy link
Member Author

@alexander-yakushev alexander-yakushev Mar 31, 2025

Choose a reason for hiding this comment

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

= was failing when arg is nil, so I switched to eq. Should I have used equal?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's much better to just wrap everything in some let that sets arg explicitly if nil. I usually do this to make sure I don't have deal with nil anywhere in a special way.

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem, I'll fix it on the next iteration.

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.

2 participants