sebastiencs / company-box

A company front-end with icons
565 stars 64 forks source link

Massive scroll bar #44

Open ar1a opened 6 years ago

ar1a commented 6 years ago

Picture

Not sure how to reproduce though

ar1a commented 6 years ago

Another image from someone else

AloisJanicek commented 6 years ago

I have exactly same problem. I was unable to reproduce it in more vanilla emacs config, but changing this line https://github.com/sebastiencs/company-box/blob/6e047e6fd7226a1b8292a74985db82bbccc679c7/company-box.el#L580 to this

          '((side . right) (window-width . 0.1)))))

sets width of scrollbar reliably to 32 pixels. I can live with that.

smallzhan commented 5 years ago

same issue here, @AloisJanicek changing "side window-width" to 0.1 doesn't help, but it seems harder to reproduce with 0.1 width. Now I totally remove the scrollbar...

forrestchang commented 5 years ago

same issue here, @AloisJanicek changing "side window-width" to 0.1 doesn't help, but it seems harder to reproduce with 0.1 width. Now I totally remove the scrollbar...

How do you fully disable the scrollbar? Can you show the hack code? @smallzhan

smallzhan commented 5 years ago

@forrestchang please refer to the gist here https://gist.github.com/smallzhan/4f8a558790133d269d5658ea85d50bf1

detailed modification:
in line 535, set the scrollbar width to 0 in fuction "company-box--update-width", then delete all the lines of calling to the function "company-box--update-scrollbar"

Majenful commented 5 years ago

I still have the scrollbar whereas I copied @smallzhan's gist

company-box

I use doom and I replaced company-box.el in ~/.emacs.d/.local/packages/elpa/company-box-xxxxx/

My info:

glepnir commented 5 years ago

@Majenful you should remove the company-box.elc then use the gist code .i tried it ,it will remove the scrollbar. image

stardiviner commented 4 years ago

I'm still got this issue. Seem no update on company-box anymore. Is there anyone want to maintain a fork?

geza-herman commented 4 years ago

For me, setting window-resize-pixelwise to nil (that's the default value) fixed the issue.

sebastiencs commented 4 years ago

I think https://github.com/sebastiencs/company-box/commit/ce8f569f9449f9a1ec1e43ee5f3e5b72cd6b0b04 might fix the issue. If anyone can test

sebastiencs commented 4 years ago

https://github.com/sebastiencs/company-box/commit/7c05cfd1cb32f161c7de1efb168b597880500473 might fix that issue too

graphcareful commented 4 years ago

I can confirm that the fix doesn't work for me. I also tried disabling golden-ratio-mode and when opening a company-box buffer I still see the issue.

sebastiencs commented 4 years ago

@graphcareful Can you please share some information about your configuration. Which OS are you using, window manager ? How did you configure company-box ? Is your .emacs.d public by any chance ?

graphcareful commented 4 years ago

Hi , I am using spacemacs, on Fedora 32, default window manager gnome3. I am configuring company-box like this: (auto-completion :variables auto-completion-use-company-box t)

I am not sure how company- and autocomplete- are supposed to work together. At first I suspected maybe two packages had conflicting configurations, but then I came here and noticed others having the same exact problem. I will try to replicate with a base spacemacs configuration.

sebastiencs commented 4 years ago

@graphcareful I just installed spacemacs to test, the only modification I made is:

.spacemacs | 3 ++-
modified   .spacemacs
@@ -37,6 +37,7 @@ values."
      ;; <M-m f e R> (Emacs style) to install them.
      ;; ----------------------------------------------------------------
      helm
+     (auto-completion :variables auto-completion-use-company-box t)
      ;; auto-completion
      ;; better-defaults
      emacs-lisp
@@ -54,7 +55,7 @@ values."
    ;; wrapped in a layer. If you need some configuration for these
    ;; packages, then consider creating a layer. You can also put the
    ;; configuration in `dotspacemacs/user-config'.
-   dotspacemacs-additional-packages '()
+   dotspacemacs-additional-packages '(company-box)
    ;; A list of packages that cannot be updated.
    dotspacemacs-frozen-packages '()
    ;; A list of packages that will not be installed and loaded.

I then ran [M-x] company-box, and the scrollbar is correct:

image

So there is a package or customization that cause this issue. If you could try to disable some package/customization made to find the culprit, that would be great

sebastiencs commented 4 years ago

@graphcareful Can you please set company-box-debug-scrollbar to t, use company-box and post the logs in the *messages* buffer

(setq company-box-debug-scrollbar t)
graphcareful commented 4 years ago

You beat me to it :) was about to do the same thing. Yes, i'll try to find the offending package and paste the logs when I find.

graphcareful commented 4 years ago

So I tried to emulate your exact settings and I am still seeing the issue.

Screenshot from 2020-09-16 18-28-05

try scrolling down with page down when there are many items to replicate.

Here are some of the logs you requested. They appeared when I am seeing the issue:

`[SCROLL] SELECTION=0 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.0 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=0.0 HEIGHT-BLANK=0.0 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [2 times] [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=2 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 38) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes) [SCROLL] SELECTION=0 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.0 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=0.0 HEIGHT-BLANK=0.0 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661

[SCROLL] SELECTION=10 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.030120481927710843 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=4.96671370165346 HEIGHT-BLANK=0.2921596295090271 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [SCROLL] SELECTION=20 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.060240963855421686 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=9.93342740330692 HEIGHT-BLANK=0.5843192590180541 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=3 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 55) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes) [2 times] [SCROLL] SELECTION=30 BUFFER= company-box-27263302-scrollbar H-FRAME=170 N-ELEMENTS=333 PERCENT=0.09036144578313253 PERCENT-DISPLAY=0.03003003003003003 SCROLLBAR-PIXEL=5.105105105105105 HEIGHT=SCROLLBAR=0.3003003003003003 BLANK-PIXELS=14.900141104960381 HEIGHT-BLANK=0.8764788885270812 FRAME-CHAR-HEIGHT=17 FRAME-CHAR-HEIGHT-NO-FRAME=17 FRAME=#<frame 0x69de800> MUL=5661 [CHANGES] CURRENT-BUFFER= company-box-27263302-scrollbar MIN-WIDTH=2 SAFE-MIN-WIDTH=2 MIN-SIZE=2 MIN-SIZE-IGNORE=2 [CHANGES] MIN CURRENT-SIZE=2 WIN-MIN-SIZE=2 WIN-PARAMS=((quit-restore window window #<window 12 on company-box-27263302> company-box-27263302-scrollbar) (window-slot . 0) (window-side . right)) FRAME-PARAMS=((parent-id . 27263302) (explicit-name . t) (display . :0) (icon-name) (outer-window-id . 27264557) (window-id . 27264561) (top . 527) (left . 8) (buried-buffer-list) (buffer-list .spacemacs) (unsplittable) (modeline . t) (width . 50) (user-size . t) (user-position . t) (name . ) (desktop-dont-save . t) (cursor-color . SkyBlue2) (background-mode . dark) (display-type . color) (default-minibuffer-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (drag-internal-border . t) (no-other-frame . t) (mouse-wheel-frame) (z-group) (skip-taskbar) (visibility . t) (fullscreen) (no-accept-focus . t) (no-focus-on-map . t) (alpha) (scroll-bar-height . 16) (scroll-bar-width . 16) (cursor-type) (auto-lower) (auto-raise) (icon-type . t) (inhibit-double-buffering) (tool-bar-position . top) (wait-for-wm . t) (title) (buffer-predicate . spacemacs/useful-buffer-p) (tool-bar-lines . 0) (height . 10) (tab-bar-lines . 0) (menu-bar-lines . 0) (min-height . 0) (min-width . 0) (scroll-bar-background) (scroll-bar-foreground) (no-special-glyphs . t) (right-fringe . 0) (left-fringe . 0) (line-spacing . 0) (screen-gamma) (border-color . black) (mouse-color . black) (background-color . #34323e) (foreground-color . #b2b2b2) (horizontal-scroll-bars) (vertical-scroll-bars) (bottom-divider-width . 0) (right-divider-width . 0) (internal-border-width . 1) (border-width . 0) (font . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-parameter . -ADBO-Source Code Pro-normal-normal-normal--13----m-0-iso10646-1) (font-backend ftcrhb x) (override-redirect) (undecorated . t) (parent-frame . #<frame emacs@x1c-laptop 0x27a0f60>) (minibuffer . #<window 4 on Minibuf-0>)) HOOKS=(evil--jumps-window-configuration-hook t company-box--scrollbar-prevent-changes)`

sebastiencs commented 4 years ago

@graphcareful Thanks !

Your issue seems different than the others

The logs you shared seem correct so we probably need to dig a bit more

graphcareful commented 4 years ago

In this stripped down config that only has autocomplete-mode and company-box installed...

Screencast from 09-18-2020 06_09_41 PM2

sebastiencs commented 4 years ago

@graphcareful Thank you for the detailed answer.

It looks like to be an emacs bugs, or an issue with your window manager and/or compositor: The frame is always keeping the same width, it should change. The frame for the documentation has a position which depends on the candidates frame width. The doc position is correct, so internally emacs has the correct width, but it doesn't update the display for the candidates frame.

Can you try to set company-box-debug-scrollbar to t with https://github.com/sebastiencs/company-box/commit/97475e4a989bfc52cdc1e4f86e5abf34c77b18be The logs will confirm if it's an emacs bug.

https://github.com/sebastiencs/company-box/commit/2c35a725682442034f9d180d1f543c508cab3fb4 might fix your issue, but I don't put much hope on it.

I tried the branch feature/nativecomp but I failed to used it with spacemacs, getting lots of errors like https://github.com/syl20bnr/spacemacs/issues/13957 Could you try on the master branch, without --with-nativecomp ?

graphcareful commented 4 years ago

@sebastiencs ok i'll try without nativecomp as well

akermu commented 3 years ago

For me it's the same issue as described here https://github.com/tumashu/company-posframe/issues/2. Setting x-gtk-resize-child-frames to 'hide or 'resize-mode fixes the issue.