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

Scrollbar issue #8

Open
jwintz opened this issue Apr 11, 2018 · 10 comments
Open

Scrollbar issue #8

jwintz opened this issue Apr 11, 2018 · 10 comments

Comments

@jwintz
Copy link

jwintz commented Apr 11, 2018

Hi, huge fan of company-box and definitely wanna try sidebar.el.

However, I can't get icons-in-terminal working on High Sierra (maybe my fault, I hacked the CoreText stuff to get all-the-icons working).

Anyway, using:

(when (display-graphic-p)
  (def-package! company-box
    :hook (company-mode . company-box-mode)
    :init
    (setq company-box-icons-elisp
          (list
           (concat (all-the-icons-material "functions") " ")
           (concat (all-the-icons-material "check_circle") " ")
           (concat (all-the-icons-material "stars") " ")
           (concat (all-the-icons-material "format_paint") " ")))
    (setq company-box-icons-unknown (concat (all-the-icons-material "find_in_page") " "))
    (setq company-box-backends-colors nil)))

I've got a scroller issue, that is, all candidates cannot be visited.

Also, whenever the scrollbar is displayed, left hand side icons are cropped.

screen shot 2018-04-11 at 23 27 53

@sebastiencs
Copy link
Owner

Thanks :)
You may also like https://github.com/sebastiencs/omnibox

However, I can't get icons-in-terminal working on High Sierra (maybe my fault, I hacked the CoreText stuff to get all-the-icons working).

This comment and the next one could probably help you to install it on mac os. It explains how to use icons-in-terminal in terminals, but if you just want to use the font on (emacs) GUI, you just need to install the font file like you would install any other font on your system (the ttf file in the build/ directory)

I've got a scroller issue, that is, all candidates cannot be visited.

What do you mean exactly ? You can't access some candidates ?

Also, whenever the scrollbar is displayed, left hand side icons are cropped.

Can you provide an image ?

@jwintz
Copy link
Author

jwintz commented Apr 12, 2018

Ok, thanks for the comment, I have installed fonts I did not already have using all-the-icons, e.g. build/icons-in-terminal, and some fonts from icons-in-terminal fonts folder, and hacked /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist to be aware of them.

So far print-icons.sh fails on Mac:

screen shot 2018-04-12 at 21 40 21

But the python script from the thread works fine:

screen shot 2018-04-12 at 21 41 00

It should however work in both situations, and we, MacOS Users would very much like to avoid hacking a file that requires to disable System Integrity Protection.

However, back to company-box :-)

Starting with emacs-lisp-mode:

screen shot 2018-04-12 at 21 45 16

See the size of the scroll bar, and consider that I'm a the bottom of provided candidates.

Now for c++-mode:

screen shot 2018-04-12 at 21 48 42

I only have few candidates as opposed to thousands when I do not use company-box.

@sebastiencs
Copy link
Owner

sebastiencs commented Apr 13, 2018

On the first image you can see that there are 2 child frames for company (3 with the doc). Looks like you have both company-childframe and company-box enabled at the same time ?
The child frame from company-childframe is overlapping on the one of company-box.

Is one front-end not enough ? :)
You need to disable company-childframe.

Does it somehow solves the issue for the 2nd image too ?

@ghost
Copy link

ghost commented Apr 13, 2018

I had a similar issue with Doom-Emacs and removing the default front-ends solved the overlap issue. However, using the Tab key to select elements still results in the scroll bar not following the selection. Also, I have C-d and C-u tied to ivy-scroll-up and ivy-scroll-down and company box's scrolling doesn't seem to respect that. Here's a screenshot:
screenshot-2018-04-13_13-52-48

@sebastiencs
Copy link
Owner

@nealot What the tab key, ivy-scroll-up and ivy-scroll-down are supposed to do, exactly ? Do theses commands work with the built-in front-end ?

@ghost
Copy link

ghost commented Apr 14, 2018

@sebastiencs Yeah, Tab is supposed to work as C-n essentially and ivy-scroll-up and ivy-scroll-down scroll the menu up or down by a large value. They actually still work but the scroll bar doesn't display their results if they leave the scroll area.

@ghost
Copy link

ghost commented Apr 16, 2018

@jwintz With company box, the number of elements available is controlled by company-tooltip-limit so you'll have to add something like setq company-tooltip-limit 1000 to see 1000 results. That looks something like this:
screenshot-2018-04-16_17-12-59
It would be better to have both a limit for the number of elements displayed and for the number of elements able to be selected via scrolling.

@dgutov
Copy link

dgutov commented Apr 16, 2018

you'll have to add something like setq company-tooltip-limit 1000 to see 1000 results

That's an odd use of this variable...

@sebastiencs
Copy link
Owner

@nealot I will rework the keymap of company-box and add commands to scroll by large value.

I see in your pictures that the start of candidates (after the icons) isn't aligned with the completion prefix in your current buffer (see the readme picture).
Can you disable display-line-numbers-mode and see if it still occurs ?

There is a bug that is fixed in emacs master branch but I thought it happened only when the completion prefix is on the very beginning of line: http://lists.gnu.org/archive/html/bug-gnu-emacs/2018-03/msg00509.html

you'll have to add something like setq company-tooltip-limit 1000 to see 1000 results

That's an odd use of this variable...

Yes I misunderstood the variable, I will change that

sebastiencs added a commit that referenced this issue May 5, 2018
I misunderstood the variable company-tooltip-limit.
Add company-box-max-candidates to control the maximum number of
candidates.
@ghost
Copy link

ghost commented May 8, 2018

The issue has been resolved for me with the recent commits.

grugrut added a commit to grugrut/dotfiles that referenced this issue Feb 6, 2019
アイコンがでかい問題があり
sebastiencs/company-box#8
を参考にしてall-the-iconsを使うように変更
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

No branches or pull requests

3 participants