-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Use visual line when visual-line-mode
is active
#227
Comments
I'll see what I can do. I rarely use On the other hand, all it takes is to rewrite |
I've never noticed any problems... Perhaps I'm just lucky
AFAIK there are no visual-line equivalents for (defun visual-line-beginning-position ()
"Return point at the beginning of the visual line."
(save-excursion
(beginning-of-visual-line)
(point))) Though I don't know how inefficient that might be. |
Thanks. |
Unfortunately, the changes seem to make swiper terribly slow, at least when compiling a list of candidates. It takes a long time (several seconds) for the swiper buffer to appear, during which Emacs is at 100% CPU-usage. Profiling the code shows that most of the processing time is spent in I also tried it with If you want to try for yourself, you can use this file: https://github.com/joostkremers/ebib/blob/master/manual/ebib.text It's long enough to show the problem. Be sure to activate Seems like supporting |
I'm aware of the problem. But there's nothing that I can do about it, short of implementing |
Yes, I was afraid it wouldn't be possible to do something about it... But would you consider making this an option? Most of the time, the buffers I use visual-line-mode in are rather large, which makes swiper too slow right now. I know, I'm the one that asked for this in the first place... |
I've enabled |
I'm afraid that makes things even worse... Granted, the delay is much smaller (there's still a slight delay there, but it would be acceptable) but swiper now finds far fewer occurrences of the search string than are actually there. Here, swiper finds 209 occurrences of While Moreover, scrolling through them in the swiper buffer highlights (visual) lines that do not match the occurrence: Results are similar when using |
* swiper.el (swiper-use-visual-line): New defvar. (swiper--candidates): (swiper--update-input-ivy): (swiper--action): Update. Re #227
OK, I've updated the logic to impose 20000 buffer size limit everywhere. In addition, the visual-line functionality is disabled for org-mode buffers, because something strange happens when using line-move with text hidden in outlines. |
I mostly write text (markdown or LaTeX) with
visual-line-mode
turned on, which means my paragraphs are actually (very) long lines. As a result, when I use swiper for searching, whole paragraphs are marked and the lines displayed in the minibuffer are so long that they often have to be truncated and the match is not visible.Would it be possible to use the visual line for matching / displaying when
visual-line-mode
is turned on in a buffer?visual-line-mode
does a pretty good job at presenting visual lines as actual lines, and using swiper in such a buffer is always a bit confusing.The text was updated successfully, but these errors were encountered: