Comments (2)
I was always wandering why I change company-box-frame-parameter
is not working.
After checking out source code, I found this is because:
(defun company-box--display (string)
"Display the completions."
(company-box--render-buffer string)
(unless (company-box--get-frame) ; the already created child-frame exist, so will not apply following new child-frame parameters.
(company-box--set-frame (company-box--make-frame)))
(company-box--set-frame-position (company-box--get-frame))
(unless (frame-visible-p (company-box--get-frame))
(make-frame-visible (company-box--get-frame)))
(company-box--update-scrollbar (company-box--get-frame) t))
So I hope company-box
can add a function to reset child-frame like this:
;; delete old child-frame, then `company-box' create new child-frame.
(delete-frame (company-box--get-frame))
(unless (company-box--get-frame)
(company-box--set-frame (company-box--make-frame)))
(delete-frame (frame-parameter nil 'company-box-doc-frame))
(unless (frame-live-p (frame-parameter nil 'company-box-doc-frame))
(set-frame-parameter nil 'company-box-doc-frame nil))
Here is my current config (as reference for you to considering circadian theme switching case):
(setq-default company-box-frame-parameters company-box-frame-parameters)
(defun my:company-box-faces-setup (theme)
"Reload company-box faces on `circadian' `THEME' toggling."
;; delete old child-frame, then `company-box' create new child-frame.
(delete-frame (company-box--get-frame))
(unless (company-box--get-frame)
(company-box--set-frame (company-box--make-frame)))
(delete-frame (frame-parameter nil 'company-box-doc-frame))
(unless (frame-live-p (frame-parameter nil 'company-box-doc-frame))
(set-frame-parameter nil 'company-box-doc-frame nil))
(set-face-attribute 'company-box-candidate nil
:inherit nil
:family (face-attribute 'default :family)
:foreground (face-foreground 'default))
(set-face-attribute 'company-box-selection nil
:inherit 'company-tooltip-selection)
(set-face-attribute 'company-box-background nil
:background (cl-case (alist-get 'background-mode (frame-parameters))
('light "#EBF4FE")
('dark (color-lighten-name (face-background 'default) 4))))
(add-to-list 'company-box-frame-parameters
`(background-color . ,(cl-case (alist-get 'background-mode (frame-parameters))
('light "#EBF4FE")
('dark (color-lighten-name (face-background 'default) 4)))))
(add-to-list 'company-box-frame-parameters
`(foreground-color . ,(face-foreground 'default)))
)
(add-hook 'circadian-after-load-theme-hook #'my:company-box-faces-setup)
from company-box.
Hi, @sebastiencs any idea on this? can you add some similar workaround for this case which the company-box child-frames is dead, or invalid problems?
from company-box.
Related Issues (20)
- Scrolling with trackpad doesn't work
- Wrong scrollbar with only two candidate completions
- icons-in-terminal not working HOT 3
- Is there a way to disable highlight by mouse pointer HOT 1
- Company box mess with frame config HOT 2
- Error HOT 7
- company-box-doc breaks lsp-java snippets HOT 1
- Company Box crashes EMACS on first display HOT 1
- Company-Box causes EMACS to freeze and slow to respond, never actually displays any completions. HOT 3
- `(wrong-type-argument integer-or-marker-p nil)` during completing Python function (with docs) HOT 15
- vertical misalignment HOT 1
- icons not displayed when candidate list very close to left margin of frame
- only activating company box in certain major modes
- How to configure border width and colour? HOT 2
- Scroll by keyboard HOT 1
- docstring popup text color HOT 1
- How to disable tab-bar-mode in company box frame?
- company-box breaks company-show-doc-buffer ?
- Etherscan HOT 1
- Warnings and Errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from company-box.