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

Font lock problem of `ivy--regex-ignore-order` #654

Closed
Yevgnen opened this Issue Sep 7, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@Yevgnen
Contributor

Yevgnen commented Sep 7, 2016

Hi,

It seem that the font lock works unexpectedly when using ivy--regex-ignore-order.

screen shot 2016-09-07 at 08 10 44

I guess file and expand should be highlighted ?

Minimum config for reproducing can be

(require 'package)

(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/")
                         ("gnu" . "http://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "http://orgmode.org/elpa/")))

(package-initialize)

(unless (and (file-exists-p (expand-file-name "elpa/archives/marmalade" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/gnu" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/melpa" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/org" user-emacs-directory)))
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(setq use-package-verbose t
      use-package-enable-imenu-support t)
(require 'use-package)

(use-package swiper
  :ensure t
  :bind (("C-s" . swiper))
  :init (setq ivy-height 15
              ivy-count-format "(%d/%d) "
              ivy-use-virtual-buffers t
              ivy-initial-inputs-alist nil
              ivy-re-builders-alist '((t . ivy--regex-ignore-order))
              swiper-include-line-number-in-search t))

Thanks !

@jyp

This comment has been minimized.

Contributor

jyp commented Sep 22, 2016

I've done some diagnosis on this one.
A special formatting function is active when ivy--regex-ignore-order is active. This formatting function is activated in ivy--format-minibuffer-line under the condition (cond ((eq ivy--regex-function 'ivy--regex-ignore-order).

This condition works typically when ivy callers do not specify a re-builder. Unfortunately, swiper unconditionally overwrites the re-builder with its own function, swiper--re-builder, so the test fails, and we get the default formatting function.

I suppose that the appropriate solution would be to support custom formatting functions, and have swiper provide the corresponding implementation.

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Sep 23, 2016

@jyp Patches welcome. I don't use iyv--regex-ignore-order, so it's not a priority for me to make it look nice.

jyp added a commit to jyp/swiper that referenced this issue Dec 14, 2016

@jyp jyp referenced this issue Dec 14, 2016

Closed

fix #654 #827

abo-abo added a commit that referenced this issue Dec 15, 2016

raxod502 added a commit to raxod502/swiper that referenced this issue May 23, 2018

raxod502 added a commit to raxod502/swiper that referenced this issue May 31, 2018

@abo-abo abo-abo closed this in 7ec2380 Jun 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment