Lsp-mode: Top bar needs context per buffer

Created on 18 Dec 2020  Â·  20Comments  Â·  Source: emacs-lsp/lsp-mode

regularly update lsp-mode and found the new top bar (SO AWESOME THANK YOU!!!)

but here's a bug - say I make two buffers of the same file - each buffer's pointer in a diferent spot - so diferent function context, but currently it will pick one of the two and use for both, so the top bar needs to be context depenednet per buffer i think
Screenshot from 2020-12-18 11-19-43

bug

Most helpful comment

I think the issue is that we use (point) which is window specific, we should use (window-point)

All 20 comments

Interesting... @ericdallo, willing to take a look?

As a side note, your font is missing the separator that we use. I guess we should make it configurable, but if you isntall all-the-icons(or use another font) the issue will go away.

@yyoncho thanks - I tried all the all-the-icon- packages (4 of them) but still didn't get the icon - I'm using pragmatapro , so rather keep the font

@ericdallo I figured out the issue, I will include it in my PR.

Hum, we should really make the breacrumb buffer aware, I don't know how hard is though, I can investigate this weekend

I think the issue is that we use (point) which is window specific, we should use (window-point)

I'm also missing some of the icons (using Spacemacs).

@fxfactorial FYI you should install https://github.com/domtronn/all-the-icons.el and then do M-x all-the-icons-install-fonts.

@yyoncho I though we had fallbacks when the user doesn't have the font :thinking:

@ericdallo the fallback is "›" which apparently is not present in all fonts.

Maybe we should change for something like >

... or make it configurable. Not sure if there is a way to check if the font has that char.

I'll take a look at this tomorow

@ericdallo let me finish my PR first because I am touching this code.

Can someone with issues run in their emacs M-: (char-displayable-p ?›)?

@fxfactorial FYI you should install https://github.com/domtronn/all-the-icons.el and then do M-x all-the-icons-install-fonts.

awesome - this worked - looks great

Unfortunately, the fix does not seem to be easy... we are using the same local variable for the header line... and when we update it updates on both windows... I am out of ideas on how to fix that without introducing performance issues.

maybe change it to a variable that holds a map with the key being the buffer?
Or using a defvar-local?

It is defvar-local. The issue is that on the left and on the right you have the same buffer, thus it cannot have a different value.

Got it :man_facepalming: not sure how to handle this

M-: (char-displayable-p ?›)

This displays the following in my *Messages* buffer:

#<font-object "-ADBO-Hasklig-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1">
Was this page helpful?
0 / 5 - 0 ratings

Related issues

yyoncho picture yyoncho  Â·  5Comments

rsuhada picture rsuhada  Â·  3Comments

cprussin picture cprussin  Â·  3Comments

axelson picture axelson  Â·  4Comments

raxod502 picture raxod502  Â·  4Comments