TheBB / spaceline

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

use tight for segments which are not always present #226

Open TheBlob42 opened 4 years ago

TheBlob42 commented 4 years ago

This is my current spaceline config:

  (spaceline-compile
    ;; left side
    '(
      [...]
      (my//lsp-status-icon
       :when active
       :skip-alternate t
       :priority 60)
      (my//lsp-info 
       :when active
       :priority 30))
    ;; right side
    [...]

my//lsp-status-icon shows simple icon to indicate the current connection status of LSP while my//lsp-info shows a string with some more information. I have separated them both into separate segments so that I can hide the info string when the window gets smaller (based on priority). My complete config looks like the following:

spaceline_1

Now there is a big "gap" between the icon and the text that I would like to get rid of. Therefore I use the tight-left parameter like so:

 (spaceline-compile
    ;; left side
    '(
      [...]
      (my//lsp-status-icon
       :when active
       :skip-alternate t
       :priority 60)
      (my//lsp-info 
       :when active
       :tight-left t  <-- this is what I added
       :priority 30))
    ;; right side
    [...]

Which looks exactly as I want it to:

spaceline_2

Now the problem occurs when I am in a buffer without lsp-mode and the icon and the info text segment are not shown:

spaceline_3

As you can see the arrow on the right has vanished due to the usage of tight-left. I have also tried different combinations with tight and tight-right which I added to the different segments. But I could not make it work.

I don't know if this is a bug, a known issue or just an error of mine :thinking: and would be very thankful for help and advise :)