-
Notifications
You must be signed in to change notification settings - Fork 152
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
Hydra last line is misaligned #360
Comments
Also notice the separator before |
I don't know what's going on here. The hydra looks correct on my end and that strange face has no right to be there, there's nothing special happening with that separator. Have you tried reinstalling? |
The hydra looks fine here as well. Tested in Emacs GUI, and in both the windows command line and windows powershell. System Info 💻
(autohotkey colors emacs-lisp git helm html markdown multiple-cursors org spell-checking treemacs version-control)
|
This is with You can see that the color of that face is slightly different.
Pretty much the last from emacs-26 branch. This is the value of hydra-str before calling defhydra:
I tried reinstalling. The problem is still there and now I have no icons at all :(. While installing I get the error:
The current install is in treemacs-20190219.603, not treemacs-20190215.627. There is a match for treemacs-20190215.627 in elpa/treemacs-20190219.603/treemacs-icons.elc. |
Well, I fixed the last problem by uninstalling, restarting and installing again (have you tried turning it off and on again). But the hydra is still wrongly aligned. |
This isn't happening for the stable release. I guess it could be caused by some changes recently done by Eli, related to visual line num mode (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32337). I'm closing this since the problem is probably in emacs core. |
I tested with Emacs 26.1.91 in Windows 10 and the hydra is aligned correctly here as well. |
There's contradictory evidence here: some say it's okay with 26.1, but not with the latest emacs-26 branch, others say that 26.1.91, which for all practical purposes is the latest emacs-26, is also okay. Would someone who sees the problem please go to the problematic character and tell what |
@Eli-Zaretskii I would like to do that but is there any quick way to deactivate the fancy hydra settings that make the window auto-close on almost every event? |
That'll be difficult. AFAIU that text is generated by lv.el, it is basically a static minibuffer message that cannot be interacted with. @abo-abo is it possible to get to a hydra's text properties? |
As long as the buffer where this text is generated still exists, you can do something like
where POS is the buffer position of that character, and BUFFER is the buffer where the text is kept (could be |
Also, minibuffer messages are generally recorded in |
Ok, if anyone figures out how to blink without closing the hydra window, please chime in. Meanwhile I'll keep bisecting. |
I've got something. You can grab the hydra's text by changing (defun lv-message (format-string &rest args)
"Set LV window contents to (`format' FORMAT-STRING ARGS)."
(let* ((str (apply #'format format-string args))
(n-lines (cl-count ?\n str))
deactivate-mark
golden-ratio-mode)
(with-selected-window (lv-window)
(unless (and (string= (buffer-string) str)
(null lv-force-update))
(delete-region (point-min) (point-max))
(insert str)
(when (and (window-system) lv-use-separator)
(unless (looking-back "\n" nil)
(insert "\n"))
(insert
(propertize "__" 'face 'lv-separator 'display '(space :height (1)))
(propertize "\n" 'face 'lv-separator 'line-height t)))
(set (make-local-variable 'window-min-height) n-lines)
(setq truncate-lines (> n-lines 1))
(let ((window-resize-pixelwise t)
(window-size-fixed nil))
(fit-window-to-buffer nil nil 1)))
(print (buffer-string))
(goto-char (point-min))))) The second to last line outputs the entire string, including all text properties. Now we just need to find the position of the badly fontified character. |
@Eli-Zaretskii the offending commit seems to be 71c92d89137b7fdde6c2bd4bed9b8dfda5fa53dd. This kinda make sense
|
Thanks. If this is the commit which breaks the code, then it's likely a bug in the code that became broken, and that commit just exposed the bug. Or maybe I'm missing something. Can someone please point me to the code which generates the text in question, including the properties? Is that the |
That particular hydra is a special case, it always shows your actual keybinds instead of a static text. That is accomplished with |
I forgot to reopen this at the time. Alexander, have you advanced your understanding of the issue? I'm asking that because I'm unsure about reporting this to the emacs tracker. |
Do you see the same problem with this hydra: (defhydra TESTHYDRA (:exit nil :hint nil :columns 5)
"
Treemacs x Helpful Hydra
Navigation │ Opening Nodes │ File Management │ Toggles │ Projects │ Misc.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
_X_: next Line │ _X_: dwim TAB │ _X_: create file │ _X_: follow mode │ _X_: add project │ _X_: refresh
_X_: prev line │ _X_: dwim RET │ _X_: create dir │ _X_: filewatch mode │ _X_: remove project │ _X_: (re)set width
_X_: next neighbour │ _X_: open no split │ _X_: rename │ _X_: git mode │ _X_: rename project │ _X_: copy path
_X_: prev neighbour │ _X_: open horizontal │ _X_: delete │ _X_: show dotfiles │ │ _X_: copy root
_X_: goto parent │ _X_: open vertical │ _X_: copy │ _X_: resizability │ │ _X_: re-sort
_X_: down next window │ _X_: open ace │ _X_: move │ _X_: fringe indicator │ │ _X_: bookmark
_X_: up next window │ _X_: open ace horizontal │ │ │ │
│ _X_: open ace vertical │ │ │ │
│ _X_: open externally │ │ │ │
│ _X_: close parent │ │ │ │
"
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("X" #'ignore)
("?" nil "Exit")) |
No, and neither do I see the original problem anymore as of:
I'm closing it. Thanks! |
¯\_(ツ)_/¯ |
Just look at the screenshot:
I tested some other hydras and they look well, but they don't have the "vertical lines" the one for treemacs shows, so I don't know... I'm not an hydra user.
The text was updated successfully, but these errors were encountered: