Comments (26)
Swiper calls font-lock-ensure
(or font-lock-fontify-buffer
for older Emacs) to have the
selection candidates highlighted. It should be OK to call these functions for any buffer that has
font-lock-mode
on.
I think it's a problem of the corresponding mode if it bugs out after a call to font-lock-ensure
.
I could add some workarounds though. What are the values of major-mode
for the problematic buffers?
from swiper.
I wasn't aware that this was the expected behavior. Would it be possible to revert the buffer to normal once the selection has been made?
from swiper.
Would it be possible to revert the buffer to normal once the selection has been made?
It's possible not to call font-lock-ensure
for problematic major-mode
s.
I've already added all modes derived from magit-mode
to this list.
I just need a list of major-mode
s which are problematic for you.
Just use M-: (eval-expression
) to see what the value of major-mode
is.
from swiper.
One is package-menu-mode
and the other is emms-playlist-mode
.
from swiper.
See if the last commit solves your issue.
from swiper.
It didn't solve. I replaced the swiper.el file with the most recent one and restarted emacs. Is there something else I need to do?
from swiper.
What's your Emacs version? Maybe you could also add a screenshot of the erased highlights in the
package menu.
from swiper.
Updating via melpa fixed the problem. I'll be replacing Isearch with swiper and see how it goes. Thanks for this!
from swiper.
You're welcome. If the same problem comes up for another mode, just reopen this issue.
from swiper.
I think org-agenda-mode
also needs to be fixed.
from swiper.
Thanks!
from swiper.
Could you also add mu4e-view-mode
and mu4e-headers-mode
?
from swiper.
Thanks.
from swiper.
w3m-mode
and elfeed-show-mode
also have problem with font-lock-fontified
, could you add them?
Also, given the large number of mode impacted, wouldn't it make sense not to use font-lock-ensure
? Why does swipe need it and isearch doesn't? What problem does it fix? If it's more often a problem than not, wouldn't it be easier to set when font-lock-ensure
should be ran instead of when not ran it?
from swiper.
@daimrod The issue is that for all modes where font-lock-ensure
does something weird, it's the fault of that mode: they use font-lock without properly defining the syntax. So the buffer may be fontified only once and can't be refreshed.
I think it's good to keep a list of these faulty modes - it may be easier to fix them in the future. For now, I'll just add w3m-mode
and elfeed-show-mode
to the list.
from swiper.
from swiper.
When font-lock-fontify-buffer
was called at emms-stream-mode
, this issue occurred.
I'm unfamiliar with font-lock
and text-property
,
but it seems all 'face
of text-property
was set to nil
after running font-lock-fontify-buffer-function
bound to font-lock-default-fontify-buffer
as a local variable,
and (font-lock-unfontify-region (point-min) (point-max))
caused this issue.
I searched for information about font-lock-fontify-buffer-function
,
and found the setting example:
(set-default 'font-lock-fontify-buffer-function 'jit-lock-refontify)
It works fine. But I'm not sure it is correct setting.
Thank you.
from swiper.
@momomo5717 Thanks, I excluded emms-stream-mode
from the fontify list.
from swiper.
Thank you for adding it!
from swiper.
It seems that I found some more:
occur-mode
, for which g restore the highlight (but also update the content of the buffer);occur-edit-mode
bongo-mode
I'm on 24.5.1. Thank you.
from swiper.
@sshbio Thanks, updated.
from swiper.
from swiper.
I found one more: vc-dir-mode
.
We are building a list that may be useful for other package writers as well.
Again, thank you for improving swiper.
from swiper.
bongo-playlist-mode
and bongo-playlist-mode
buffers also loose their pretty colors.
Thank you for your previous additions. Hopefully I will get a copyright assignment, and will be able to submit pull requests.
from swiper.
This list may become pretty long! sauron-mode
also seems to be one of them.
from swiper.
Would you please add notmuch-tree-mode
and notmuch-search-mode
to the list?
from swiper.
Related Issues (20)
- Counsel-ag has spurious unicode matches HOT 6
- Insert current candidate for edit HOT 1
- Startup speed
- counsel-rg does not respect matcher selection
- `swiper-all` doesn't revert to starting point when cancelled (`C-g`)
- Support for soft wrap in counsel-minibuffer-history HOT 1
- Support `isearch-fold-quotes-mode` in swiper HOT 5
- counsel-rg displays "1 more chars" even when rg has already started HOT 1
- ivy-current-match face sometimes fails to take effect
- ivy-read with :dynamic-collection and elisp function HOT 3
- A call to counsel-locate errors out when first character in search is a minus sign HOT 1
- ivy-next-history-element breaks future history when there's no symbol at point
- spooky behavior with ivy-occur from projectile-find-file
- Swiper: `Error in post-command-hook (ivy--queue-exhibit): (wrong-type-argument number-or-marker-p nil)` (with org-mode?) HOT 1
- Using `sort` instead `cl-sort` in "swiper.el" HOT 2
- Require `transient` module to avoid native compiler warning HOT 2
- counsel-yank-pop is very slow HOT 3
- counsel--project-current should use project-root HOT 3
- counsel-M-x starts with ^ character HOT 1
- counsel-git-grep-other-window HOT 3
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 swiper.