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

Create user option to highlight full candidate line. #208

Merged
merged 9 commits into from
Oct 14, 2020

Conversation

okamsn
Copy link
Contributor

@okamsn okamsn commented Sep 27, 2020

This really only makes a noticeable difference when there isn't text at the right margin, but I still find it helpful.

Should anything else be changed?

…ates-display-string.

Replace sexp "(equal index highlighted-index)" with variable
"formatting-current-candidate" in function
"selectrum--candidates-display-string".
Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

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

No, seems great to me. I hadn't even thought about this, but it's a good option to have. Want to add a changelog entry for it?

Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

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

Oh yes, and we should also have something in the README since this is a public user option.

@raxod502 raxod502 added the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label Sep 27, 2020
selectrum.el Outdated
Comment on lines 343 to 345
The default is to only highlight the displayed candidate text,
though if the candidate has text displayed at the right margin,
then the entire line will be highlighted anyway."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we shorten this to "The default is to only highlight the displayed text"? That would be a bit easier to read/understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is changed.

Copy link
Collaborator

@clemera clemera Sep 28, 2020

Choose a reason for hiding this comment

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

Thanks, I meant leaving off the ",though if..." part, too. I don't think it's needed because " The default is to only highlight the displayed text" should be sufficient. The "though if..." only describes a detail following from this statement, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, thanks!

@okamsn
Copy link
Contributor Author

okamsn commented Sep 29, 2020

I was unsure about clarifying between a candidate's displayed text and the "not-annotation" part of the candidate, and between a line of text and the horizontal space on the screen in which the line of text is located.

Similarly, should the variable's name be changed to clarify that it applies only to the current candidate, and not some other kind of formatting done to the other candidates?

@clemera
Copy link
Collaborator

clemera commented Sep 29, 2020

Similarly, should the variable's name be changed to clarify that it applies only to the current candidate, and not some other kind of formatting done to the other candidates?

Hm, maybe selectrum-highlight-current-candidate-line or selectrum-highlight-current-line? I think entire line isn't strictly true anyway when there are indices for example.

@okamsn
Copy link
Contributor Author

okamsn commented Oct 3, 2020

After thinking about it, I feel that selectrum-extend-current-candidate-highlight is a good name that describes what is happening without being confused with something else (as far as I'm aware).

Do you think that this extending should also happen for the input line? I originally only thought about the candidates, to not be obscured by the selectrum-*-highlight faces as much.

@raxod502
Copy link
Member

raxod502 commented Oct 6, 2020

The new name seems fine to me, although maybe @clemera will have another suggestion. It seems to me like extending should probably happen for the input line as well, for consistency, unless that looks odd.

@clemera
Copy link
Collaborator

clemera commented Oct 7, 2020

I also like the new name! It feels natural to me that only the input gets selected, highlighting the input line would require changes to how we insert the overlay, but I leave that to @raxod502 to decide.

@raxod502
Copy link
Member

I'm fine with doing it either way.

@clemera
Copy link
Collaborator

clemera commented Oct 13, 2020

Is there anything left you would like to add @okamsn?

@okamsn
Copy link
Contributor Author

okamsn commented Oct 14, 2020

No, I am content with the current changes. Thank you.

@clemera
Copy link
Collaborator

clemera commented Oct 14, 2020

Thank you! I just noticed the dashes for the let bound variable names, which can lead to accidentally binding dynamic var names of other packages. But with the given names and the code within the let body a collision seems very unlikely so I think it's okay in this case. We can convert those cases at some later point throughout the whole package.

@clemera clemera merged commit 3e5d023 into radian-software:master Oct 14, 2020
@raxod502
Copy link
Member

I just noticed the dashes for the let bound variable names

Which variable names were you looking at here?

@raxod502 raxod502 removed the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label Oct 17, 2020
@clemera
Copy link
Collaborator

clemera commented Oct 17, 2020

formatting-current-candidate, right-margin and so on. It's very unlikely to get into conflict issues with these so it was a bit pedantic to mention them, on the other hand making it a habit to avoid dashes in let bound variables can be useful, it's a subtle issue which is easy to overlook.

@raxod502
Copy link
Member

Fair enough. I had never thought about it before, but it's true, that could happen.

@okamsn okamsn deleted the hl-full-line branch October 23, 2020 00:22
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