Comments (5)
So, from reading company's source, it seems it only supports using one face for highlighting matches. A company backend can provide a match
operation that computes a list of intervals to highlight and they always get highlighted with the company-echo-common
face.
Now, how does company wind up using completions-common-part
then? Well, company comes with a company-capf
backend that uses the standard capf (completion at point functions) API, capf in turn uses completion styles. The company-capf backend's implementation of match
goes through the candidates and searches for the completions-common-part
face, and returns those intervals. At some point later company applies company-echo-common
to those intervals.
In other words, you can't get easily get company to whatever the faces the completion style wants: company-capf will take of note of where it finds completions-common-part
and then in a separate step apply to those intervals the only face it uses to highlight matches, company-echo-common
.
So I think if people want more faces in company, company needs to change (for example, the match
operations could be generalized: instead of just returning a list of intervals, it could be allowed to return a list of intervals with faces for each). Maybe it's reasonable to propose that over at company.
In the meantime, if you are satisfied with highlighting all matching portions with the same face, you can use this:
(defun orderless--use-completions-common-part (fn &rest args)
(let ((orderless-match-faces [completions-common-part]))
(apply fn args)))
(advice-add 'company-capf--candidates
:around #'orderless--use-completions-common-part)
I think I'll add this to the README in a new "integration with company" section.
from orderless.
Oh. I'll read the flex source code to se how they do it.
from orderless.
Mmh. It looks like company is specifically looking for the face completions-common-part
... :( (And changing orderless
to use only that face does make the highlighting appear in company.)
I'll think about detecting use through company and in that case using only that face. But maybe company should actually allow more than one face for higlighting matches.
from orderless.
I've added a section to the README on Company integration now. I think that's really all that can be done on this end for the highlighting. Maybe we can close this issue.
from orderless.
Okay, I opened an issue on the company repo. Thanks for the workaround.
from orderless.
Related Issues (20)
- Release new version 0.8 on GNU ELPA HOT 7
- Completion variables recommended configuration HOT 3
- Orderless never returns a sole match for `switch-to-buffer` HOT 2
- Non-greedy match for orderless-flex? HOT 9
- Prescient defines a completion style
- How do I dispatch filtering on a suffix? HOT 3
- Ido or icomplete HOT 2
- Multiple matches, and/or over specifying candidates HOT 2
- I can't get the suggsted configuration for integration with Company to work. HOT 3
- Confusing highlighting when using `orderless-flex` style HOT 3
- Orderless with a single component HOT 3
- possible bug in completion style for repeated pattern HOT 12
- It doesn't seem to affect `C-x b` the same way as, e.g., `M-x` HOT 2
- Add simple affix dispatcher HOT 11
- I've been thinking about using it for Embark and maybe removing the `embark-define-keymap` macro in favor of `defvar-keymap`. HOT 1
- FEATURE REQUEST: Consider making your personal configuration the default (doc does not help get to that solution) HOT 8
- How to disable orderless for company or corfu HOT 8
- Get file basename? HOT 19
- Use company, orderless, company-fuzzy, auctex, and ispell all together. HOT 6
- Orderless doesn't work as desired. 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 orderless.