TheBB / spaceline

Powerline theme from Spacemacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magit commit destroys the powerline

anka-213 opened this issue · comments

Description :octocat:

Every time I make a commit using magit (<spc> g s and then c c), the powerline gets destroyed and replaced with a line containing just the title of the major-mode.

Reproduction guide 🪲

  • (Enable the git layer in spacemacs)
  • Start Emacs
  • Open a file in a git repository
  • Open the git status window (<SPC> g s)
  • Start making a commit (press c c in the status window)
  • My beautiful powerline is gone. :(

Observed behaviour: 👀 💔

After starting a commit the powerline is gone. It stays gone even after committing.

The only ways I've found to restore the powerline are either to restart emacs or running M-x spaceline-compile.

spaceline-not-working

Expected behaviour: ❤️ 😄

The powerline should stay in its place. Or at least be restored after finishing a commit.

spaceline-working

System Info 💻

  • OS: windows-nt
  • Emacs: 25.1.1
  • Spacemacs: 0.200.10
  • Spacemacs branch: master (rev. 4bb4cb46)
  • Spaceline version: spaceline-20171111.334
  • Magit version: magit-20180124.1149
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(yaml lua javascript
      (haskell :variables haskell-completion-backend 'ghci haskell-enable-hindent-style "johan-tibell")
      agda helm
      (auto-completion)
      emacs-lisp git github org)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS

I'm getting this too. I don't get it with magit but I can reproduce it consistently in mu4e. I have a bookmark for mu4e that has a particularly long search query, which are displayed in the global segment.

My spaceline segments are ordered something like this:
buffer-modified | buffer-id | flycheck | version-control | erc-track | process | | selection-info | global | buffer-position

When I use this query the global segment disappears as well as all those to the left of it up to the buffer-id resulting in this:
buffer-modified | buffer-id | | buffer-position

My guess is that this is some kind of overflow problem then because it happens consistently whenever the global segment expands to be greater than the available empty space.

I see that the spaceline--adjust-to-window will automatically hide segments if the modeline is longer than the window width. Probably the problem lies somewhere there?

I also found that setting spaceline-responsive to nil, which disables the above behaviour, solves the problem.

@anka-213 does setting spaceline-responsive solve it for you too? If so, then we might both be looking at the same issue.

In the most recent version, the global segment has the lowest possible priority and will be among the first segments hidden. I just tried making an artificially long global segment and I'm left with much more than the buffer ID segments, also the leftmost (highlighted) segment, major mode, minor mode, encoding, buffer position and HUD are all visible.

I've tried with the lastest version and setting spaceline-responsive back to t. I have the same behaviour as I mentioned above where the segments get hidden and only display again if I run (spaceline-compile).

Do I understand spaceline--adjust-to-window correctly in that it should automatically show the hidden segments again once the total-length decreases? If so, I'm not sure why but this doesn't seem to be happening, at least in my case.

I don't know if it makes a difference but I'm building my own mode-line with spaceline-install, that has a few custom segments (mostly just some ideas that I liked from domtronn/spaceline-all-the-icons.el). When I get a chance I'll see if I can replicate the issue with the default mode-line as well.

If you use spaceline-install directly, maybe you need to adjust the priorities so that the segments you expect to be hidden first, will be. By default everything has the same priority so spaceline will be free to choose arbitrarily.

I've changed my spaceline config so that it consists only of this:

(require 'spaceline-config)
(spaceline-spacemacs-theme)

If the global segment gets extremely long then it gets hidden, as expected, but it doesn't get unhidden again afterwards unless I run spaceline-compile.

What conditions need to be met in order for it to be unhidden automatically?

Yeah okay, I see the bug now. Lengths are updated when the segments are rendered, but segments that are hidden won't be rendered. This feature was designed more for varying window widths than varying segment lengths.

Please try #188

That works perfectly! The segments now automatically display again after they've been hidden.

Thank you so much for the time and effort you've put into investigating and fixing this.

No problem, thanks for testing :-). If no problems show up I will merge in a couple of days.

I am on the development version 0.300 and I am still having this problem. Was this supposed to be fixed?

The modeline looks as expected for me in both Manjaro and Windows.

On the latest Spacemacs develop branch:
Use timeclock-mode-line-display in default bindings (#14713) syl20bnr/spacemacs@d72e512
with updated packages.

Screenshots from Manjaro

Before committing

VirtualBoxVM_2021-04-26_14-15-25

While committing

VirtualBoxVM_2021-04-26_14-15-44

After having committed

VirtualBoxVM_2021-04-26_14-16-08

Manjaro, Click to expand
#### System Info :computer:
- OS: gnu/linux
- Emacs: 27.2
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. d72e51299)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(emacs-lisp git helm multiple-cursors treemacs)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Windows 10, Click to expand
#### System Info :computer:
- OS: windows-nt
- Emacs: 27.2
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. d72e51299)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion autohotkey c-c++ emacs-lisp
                 (git :variables)
                 helm html lsp markdown multiple-cursors
                 (org :variables org-agenda-files
                      '("c:/Users/username/org/"))
                 python shell spell-checking syntax-checking treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

I am on Ubuntu 20.04
Using i3wm (not that I think that matters)

Staging is fine:
spaceline1

Its when I enter the commit interface that the spaceline get clobbered and then doesn't come back.
spaceline2

Here is my .spacemacs file (extension changed to allow me to uplod to github)
spacemacs.txt