Skip to content
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

[Bug] Modeline isn't setup correctly after helm candidates update #584

Closed
2 of 3 tasks
lerouxrgd opened this issue Oct 23, 2022 · 10 comments
Closed
2 of 3 tasks

[Bug] Modeline isn't setup correctly after helm candidates update #584

lerouxrgd opened this issue Oct 23, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@lerouxrgd
Copy link

Thank you for the bug report

  • I am using the latest version of doom-modeline related packages.
  • I checked FAQ.
  • You may also try reproduce the issue using clean environment and minimal configurations with
    the command emacs -Q.

Bug description

When using a helm command that has dynamic candidates (helm-ag or helm-fd for instance), the doom-modeline is displayed/setup correctly at start:

image

But when I type some input that yields candidates, then the modeline is displayed/setup without doom-modeline:

image

Note that if I move (line up/down) then the modeline is displayed correctly. If there are no candidates after my input, the modeline is also displayed correctly:

image
image

Steps to reproduce

Type:

;; M-x eval-expression
(helm-do-ag (cdr (project-current)))

;; M-x eval-expression
(helm-fd-1 (cdr (project-current)))

Then type some input

Expected behavior

The modeline should be displayed with doom-modeline settings after candidates update.

OS

Linux

Emacs Version

28

Emacs Configurations

Vanilla

Error callstack

No response

Anything else

My config is as follows:

(use-package doom-modeline
  :hook (window-setup . doom-modeline-mode)
  :config
  (setq doom-modeline-icon t
        doom-modeline-major-mode-icon nil
        doom-modeline-minor-modes t
        doom-modeline-buffer-file-name-style 'relative-from-project
        doom-modeline-buffer-encoding nil)
  (add-hook 'helm-minibuffer-set-up-hook
            (lambda () (advice-add #'doom-modeline--active :override (lambda () t))))
  (add-hook 'helm-cleanup-hook
            (lambda () (advice-remove #'doom-modeline--active (lambda () t))))
)
@lerouxrgd lerouxrgd added the bug Something isn't working label Oct 23, 2022
@seagle0128
Copy link
Owner

Why do you setup these?

(add-hook 'helm-minibuffer-set-up-hook
            (lambda () (advice-add #'doom-modeline--active :override (lambda () t))))
  (add-hook 'helm-cleanup-hook
            (lambda () (advice-remove #'doom-modeline--active (lambda () t))))

@lerouxrgd
Copy link
Author

This is as per your advice, otherwise I have the same graphic bug as #114

Note that I tried removing them, I still have the bug described in this issue

@seagle0128
Copy link
Owner

seagle0128 commented Oct 23, 2022

This is as per #114 (comment), otherwise I have the same graphic bug as #114

Okay. I got that. It's a workaround and I think it may be not necessary currently.

I tested with helm-rg since I am not using ag. The functionality is fine.

image

Please test with emacs -Q to make sure your private configurations won't impact.. I don't think helm-do-ag or helm-fd-1 is a proper step to reproduce.

@lerouxrgd
Copy link
Author

I used to use helm-rg too, sadly it is now unmaintained and therefore I stopped using it. I tried it quickly again and indeed the issue does not happen.

However helm-ag is maintained as part of Emacs Orphanage and helm-fd is part of helm itself. Therefore they are both more up to date regarding official helm and as such helm-do-ag and helm-fd-1 are actually better steps to reproduce that helm-rg which is outdated (I suspect this is why the issue is not happening with it).

I will try to reproduce with a configuration from scratch, but honestly I don't think there is anything special in my config that interacts with doom-modeline.

@seagle0128
Copy link
Owner

Got you! I think there may be some special handles of mode-line in helm. Will check later.

@seagle0128
Copy link
Owner

seagle0128 commented Oct 23, 2022

After I research for a while, I realized the mode-line-format was set by helm after an async process finished. I am afraid it is not able to override the behaviors.

If you happen to know the solution, please let me know kindly. Thanks!

@lerouxrgd
Copy link
Author

Thank you for narrowing it down.

Indeed it looks like there isn't much we can do for helm-fd therefore I opened a PR there.

As for helm-ag this can actually be fixed with:

(setq helm-ag-show-status-function nil)

Maybe this can be set in doom-modeline-segments.el at the Helm section ?

@seagle0128
Copy link
Owner

Yes. I can handle helm-ag, but nothing to do for others, liks helm-fd, helm-grep, helm-locate, etc.

@lerouxrgd
Copy link
Author

Actually since my PR has been merged in helm, for helm-fd you can now do:

(setq helm-fd-mode-line-function nil)

@seagle0128
Copy link
Owner

My solution is (advice-add #'helm-display-mode-line :after #'doom-modeline-set-helm-modeline).

It's better if you can submit some PRs for other helm functions, to add some hooks or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants