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

helm-ucs candidates wrap around #1365

Closed
blaenk opened this issue Jan 30, 2016 · 6 comments
Closed

helm-ucs candidates wrap around #1365

blaenk opened this issue Jan 30, 2016 · 6 comments

Comments

@blaenk
Copy link

blaenk commented Jan 30, 2016

My window width is 85 and as far as I have seen, helm-ucs is the only helm command where the candidates seem to wrap around unless I increase my window size to 96.

I imagine this is because the characters are shown right-aligned, and perhaps some fixed-width is being used in the calculation for that alignment. Is there a way base it on the window width? Or at the very least customize the width used for the calculation?

@thierryvolpiatto
Copy link
Member

Jorge Israel Peña notifications@github.com writes:

My window width is 85 and as far as I have seen, helm-ucs is the only
helm command where the candidates seem to wrap around unless I
increase my window size to 96.

I imagine this is because the characters are shown right-aligned, and
perhaps some fixed-width is being used in the calculation for that
alignment. Is there a way base it on the window width? Or at the very
least customize the width used for the calculation?

The aligment is calculated using the longest candidate.

i.e:

aa
bbbbbbbbbbbbbbbbbbbbbbbb

You don't see this longest candidate because of candidates-number-limit.
If we align shorter than this longest candidate, when you will match it
candidates will be no more aligned.

Thierry

@blaenk
Copy link
Author

blaenk commented Jan 31, 2016

Ah yes, that makes sense. Thanks for responding.

I was previously using helm-unicode but I found out about this command so I figured I would get rid of that package. I know it seems like an insignificant thing to just resize my window, but it doesn't feel right that I have to simply for this command.

Is there perhaps any way to base the calculation off of the longest candidate within the currently shown candidates? That way this wrap around would only occur if this longest candidate shows up in the results?

Or could we perhaps come up with some alternatives, even if opt-in? For example, perhaps an opt-in option to not right-align the character information, instead just indent it a bit? helm-unicode doesn't have this problem because it simply shows the character right after the character name instead of right-aligning it. However, I agree that right-aligning it like helm-ucs does is nicer and easier to quickly read/see the characters. Perhaps if we could have a compromise like I mentioned above.

Actually, what if we show each candidate as the reverse of what it is now, this way we can quickly locate the characters at the beginning, and we can know where the name begins --- even if there is no alignment of the information, it is quickly identifiable and easy to locate:

§ (#xa7) SECTION SIGN

I feel like this would be an amazing way to display it. Could we perhaps have an option for that? If not, could there be a way for me to set that for myself? Please? I would really really really appreciate it.

@thierryvolpiatto
Copy link
Member

I am working on this, will be ready soon.
I have also added the posibility to find reference of unicode character at point if some.

@blaenk
Copy link
Author

blaenk commented Feb 8, 2016

Wow, that's great to hear! I hadn't considered that idea.

What approach are you taking for the wrapping issue? I'm liking the idea of showing the character first, instead of having to move my eyes to the right side of the screen, but I suppose as long as it stops wrapping I'll be content 😄

thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs--max-len):
(helm-calculate-ucs-max-len): Use maximize, return a cons cell for now.
(helm-ucs-init): Fix calculation of length.
(helm-ucs-insert): Fix regexp.
(helm-ucs-insert-char): Reorder.
(helm-ucs-insert-code): Reorder.
(helm-ucs-insert-name): Reorder.
(helm-source-ucs): Fix match-part.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-calculate-ucs-max-len): Do it.
(helm-ucs-init):                             Do it.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-calculate-ucs-max-len): Do it.
(helm-ucs-init): Apply it.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
Alignment still not fully fixed.
* helm-font.el (helm-calculate-ucs-max-len): Return again a cons.
(helm-ucs-init): Change again alignment.
(helm-ucs-insert): Fix regexp.
(helm-ucs-insert-char): Use it.
(helm-ucs-insert-code): Use it.
(helm-ucs): Allow matching char at point.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs): Check if char-after is non-nil.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs-init): Do it.
(helm-source-ucs): Use buffer-substring to get lines.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs-insert): Do it.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-font): Group.
(helm-ucs-char): Face.
(helm-ucs-init): Use them.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs-init): Only 2 fixed for now.
thierryvolpiatto added a commit that referenced this issue Feb 10, 2016
* helm-font.el (helm-ucs-init): Do it.
@thierryvolpiatto
Copy link
Member

Showing the character first complicate matching, so it is now shown after the code and before the name.
Alignment is not perfect because I had difficulties measuring length of characters, but is is not too bad.
Perhaps I will do some more modifications later.
Closing for now.

@blaenk
Copy link
Author

blaenk commented Feb 12, 2016

Cool thanks! The helm-ucs-char color you chose was hardly visible on my end, but I customized it 😄

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

No branches or pull requests

2 participants