TheBB / spaceline

Powerline theme from Spacemacs
GNU General Public License v3.0
536 stars 59 forks source link

Hiding a long buffer name hides all spaceline segments #147

Closed Stebalien closed 6 years ago

Stebalien commented 7 years ago

When a long buffer name segment is hidden, the buffer name segment on all other windows (and all segments after that) are also hidden.

Note: This only happens when a long buffer name is hidden. When a short buffer name is hidden, segments in other windows aren't affected.

Screen Shots

Before switching to a buffer with a long name

with-buffer-names

After switching

missing-buffer-names

deb0ch commented 7 years ago

Hum, that needs investigation.

Does it only happen with xwidget / web buffers, or with any buffer with a long name ?

Stebalien commented 7 years ago

Any buffer with a long name. For me, the cutoff is around 60 characters.

et2010 commented 7 years ago

Any updates on this?

TheBB commented 7 years ago

It should be enough to give the buffer name segment (and other segments that tend to be long) a lower priority, so that it is the first candidate for hiding.

TheBB commented 7 years ago

I've made an update that changes the priority of this segment. It should be among the first to hide now.

et2010 commented 7 years ago

It works! Thanks for the fix!

osv commented 7 years ago

How to customize priority for buffer name after 07235fe45569c6fa669ba6426b806b8c81b26d65? I want to see file name as far as possible

TheBB commented 7 years ago

Hang on, we still haven't decided on what meaning the priority keyword should have.

TheBB commented 7 years ago

But if you're interested the current version, you can set it to –10 or something similarly low.

acowley commented 6 years ago

I apologize for this dumb question, but to echo @osv, what is the easiest way to customize the priority of a segment? The buffer-id segment begin hidden is a mild nuisance for me, too. It happens to me quite often when switching workspaces on macOS. Deleting other windows (in emacs parlance) brings it back, then I can resplit the frame to get back to the mode line displaying as intended.

deb0ch commented 6 years ago

@osv @acowley The question isn't dumb.

To set the priorities the way you want you can copy and paste the spaceline definition in spaceline-config.el. Copy the spaceline-spacemacs-theme function if you are using Spacemacs, spaceline-emacs-theme if you are using vanilla Emacs (don't forget to copy spaceline--theme as well).

Then just rename the functions (or extract the code), modify it and use it from your dotfile.

If you do that keep in mind that the priority sorting algorithm might change in a near future, so you'll have to tweak it of you notice breakings.

By the way, in Spacemacs you can display in the echo area the name of the file the buffer is visiting by pressing <SPC> f y.

TheBB commented 6 years ago

This should be fixed now.