doomemacs icon indicating copy to clipboard operation
doomemacs copied to clipboard

Resizing window with doom-dashboard increasingly cuts off right side of modeline

Open Jdogzz opened this issue 2 years ago • 15 comments

I confirm that...

  • [X] I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved.

  • [X] I have read "How to Debug Issues", and will use it to provide as much information about this issue as possible.

  • [X] The issue can be reproduced on the latest available commit of Doom.

  • [X] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. (Unstable versions end in .50, .60, or .9x)

Expected behavior

When resizing the window, with doom-dashboard open on launch, the right side of modeline will adjust to stay visible.

Current behavior

Right side of modeline on doom-dashboard screen becomes increasingly cut off when window is resized larger than default. Other screens don't seem to cause problems with the modeline when the window is being resized.

Video of problem: https://github.com/doomemacs/doomemacs/assets/2792697/71e4188f-8aa4-4d2e-9a31-4a4aba5725b7

After initially reporting the bug to doom-modeline, the problem could not be reproduced with emacs -Q and running the modeline in dashboard mode, and it was suggested reporting it with the doom repo: https://github.com/seagle0128/doom-modeline/issues/668

Steps to reproduce

  1. Open emacs
  2. Resize window larger and larger

This happens even with a fresh install of doom emacs with no config changes.

System Information

https://pastebin.com/3NpYrRfA

Jdogzz avatar Sep 27 '23 14:09 Jdogzz

Just gave it a quick try with my config on Emacs 29 PGTK and couldn’t reproduce. Might be specific to GTK/X11 Emacs builds or Emacs 28.

hpfr avatar Sep 27 '23 23:09 hpfr

I also have this exact same issue currently on emacs-nativecomp 29.1-4 artix linux

Zerogaku avatar Dec 25 '23 10:12 Zerogaku

I am on Fedora 39, have Emacs v29.1, and the gui version of doom-emacs' doom-modeline's right side gets cut off. Just checked the cli version and the doom-modeline has the same problem here, too.

keevee09 avatar Dec 26 '23 07:12 keevee09

Could you pls check the version of doom-modeline?

seagle0128 avatar Dec 27 '23 02:12 seagle0128

Running M-x pkg-info-version-info on doom-modeline gives me version 4.0.2, i'm not sure if it's the same for others

Zerogaku avatar Jan 05 '24 16:01 Zerogaku

It seems to be caused by the configurations of doom emacs.

seagle0128 avatar Jan 06 '24 16:01 seagle0128

I see the same thing: I also have a fresh, unmodified install of doom emacs, Ubuntu 22.04.3 LTS, emacs-gtk 27.1, doom-modeline 4.0.2, and the very first thing I did after installing and launching emacs for the first time was to resize the opening frame wider, and noticed that the string "DOOM v3.0.0-rep" got repositioned so that it extended off the right edge of the modeline/frame more and more until it disappeared entirely when the frame was wide enough.

keaaw avatar Jan 15 '24 05:01 keaaw

Open a file, and check again. It should work as expected. It is only an issue with the doom-emacs splashscreen for me.

On Mon, 15 Jan 2024, 11:39 keaaw, @.***> wrote:

I see the same thing: I also have a fresh, unmodified install of doom emacs, Ubuntu 22.04.3 LTS, emacs-gtk 27.1, doom-modeline 4.0.2, and the very first thing I did after installing and launching emacs for the first time was to resize the opening frame wider, and noticed that the string "DOOM v3.0.0-rep" got repositioned so that it extended off the right edge of the modeline/frame more and more until it disappeared entirely when the frame was wide enough.

— Reply to this email directly, view it on GitHub https://github.com/doomemacs/doomemacs/issues/7466#issuecomment-1891345084, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUU7K3T7I6PMW42RUNCG7DYOTAC7AVCNFSM6AAAAAA5JOISYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGM2DKMBYGQ . You are receiving this because you commented.Message ID: @.***>

keevee09 avatar Jan 15 '24 15:01 keevee09

According to this snippet, it's related to +doom-dashboarrd-mode.

https://github.com/doomemacs/doomemacs/blob/03d692f129633e3bf0bd100d91b3ebf3f77db6d1/modules/ui/modeline/config.el#L39C3-L39C78

Try evaluate the snippet below

(define-derived-mode +doom-dashboard-mode special-mode
  (format "DOOM v%s" doom-version)
  "Major mode for the DOOM dashboard buffer."
  :syntax-table nil
  :abbrev-table nil
  (buffer-disable-undo)
  (setq truncate-lines t)
  (setq-local whitespace-style nil)
  (setq-local show-trailing-whitespace nil)
  (setq-local hscroll-margin 0)
  (setq-local tab-width 2)
  ;; Don't scroll to follow cursor
  (setq-local scroll-preserve-screen-position nil)
  (setq-local auto-hscroll-mode nil)
  ;; Line numbers are ugly with large margins
  (setq-local display-line-numbers-type nil)
  ;; hl-line produces an ugly cut-off line highlight in the dashboard, so don't
  ;; activate it there (by pretending it's already active).
  (setq-local hl-line-mode t))

seagle0128 avatar Jan 16 '24 06:01 seagle0128

@seagle0128 I evaluated the snippet in the scratch buffer, switched back to the doom dashboard, and nothing changed, resizing the frame wider and the version number gets shuffled off the right edge of the window

keaaw avatar Jan 17 '24 11:01 keaaw

@keaaw Okay. Try narrowing the thread.

(define-derived-mode +doom-dashboard-mode special-mode
  (format "DOOM v%s" doom-version)
  "Major mode for the DOOM dashboard buffer."
  :syntax-table nil
  :abbrev-table nil
  (buffer-disable-undo)
  (setq-local tab-width 2)
  ;; Line numbers are ugly with large margins
  (setq-local display-line-numbers-type nil)
  (setq-local hl-line-mode t))

seagle0128 avatar Jan 17 '24 13:01 seagle0128

@seagle0128 My apologies, both the first and second snippets work. I wasn't testing properly the first time (didn't call +doom-dashboard-mode after evaluating).

keaaw avatar Jan 18 '24 06:01 keaaw

Great!

On Thu, 18 Jan 2024, 11:52 keaaw, @.***> wrote:

@seagle0128 https://github.com/seagle0128 My apologies, both the first and second snippets work. I wasn't testing properly the first time (didn't call +doom-dashboard-mode after evaluating).

— Reply to this email directly, view it on GitHub https://github.com/doomemacs/doomemacs/issues/7466#issuecomment-1897861664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUU7KYSNRQOBCLXPQHS2NTYPC3ZZAVCNFSM6AAAAAA5JOISYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJXHA3DCNRWGQ . You are receiving this because you commented.Message ID: @.***>

keevee09 avatar Jan 18 '24 07:01 keevee09

So the root cause is here

(cl-loop for (car . _cdr) in fringe-indicator-alist
           collect (cons car nil) into alist
           finally do (setq-local fringe-indicator-alist alist))
(add-hook 'post-command-hook #'+doom-dashboard-reposition-point-h nil 'local)

seagle0128 avatar Jan 18 '24 09:01 seagle0128

Thanks for the tip!

On Thu, 18 Jan 2024, 15:32 Vincent Zhang, @.***> wrote:

So the root cause is here

(cl-loop for (car . _cdr) in fringe-indicator-alist collect (cons car nil) into alist finally do (setq-local fringe-indicator-alist alist)) (add-hook 'post-command-hook #'+doom-dashboard-reposition-point-h nil 'local)

— Reply to this email directly, view it on GitHub https://github.com/doomemacs/doomemacs/issues/7466#issuecomment-1898138024, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUU7KYD2BN4PS7UAMDAOUDYPDVT5AVCNFSM6AAAAAA5JOISYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYGEZTQMBSGQ . You are receiving this because you commented.Message ID: @.***>

keevee09 avatar Jan 18 '24 11:01 keevee09