-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp-ui-sideline wrong width calculation? #285
Comments
I am unable to repro with clean config and using emacs26.2. You may follow the instructions in #284 to disable the sideline. Which window manager do you use? |
I seem to recall investigating this before, and the problem was the box around the last word, which extends beyond the character bounds, so the end of char calculation is wrong. So in my customisation section I have '(lsp-ui-sideline-current-symbol ((t (:foreground "gray" :box (:line-width -1 :color "cyan") :weight ultra-bold :height 0.99)))) Which basically makes the char size slightly smaller, so the regular calculation error is not longer a problem. |
Wild idea, may be
icewm |
Looks like difference in my case is bigger, so your receipt doesn't work as is. I am able to reproduce your
I remove my font preferences, it looks like no bugs, But if I enable these lines in my (if (eq window-system 'x)
(progn
(message "we running under X Window system")
(set-default-font "Consolas-11")
(set-fontset-font (frame-parameter nil 'font)
'han '("Vera Sans YuanTi" . "unicode-bmp"))
)) the bug appears again, some problem with not monospace font? P.S. |
Hi @Dushistov, does f2e2f74 fix your issue ?
|
Thank you, @sebastiencs ! I updated lsp-ui to 20190507.700 and looks it's code contains f2e2f74 . fringe-mode mode gives (25 . 0) |
Hello, I seem to have the same problem, with scala code. I think that it comes from the font-locked string. If I change the code in function lsp--fontlock-with-mode (file lsp-mode) to return the raw string, the problem disappears. The box around the function is not the problem. I also have a very recent version incorporating f2e2f74. Here is my modified function: (defun lsp--fontlock-with-mode (str mode)
"Fontlock STR with MODE."
str) I also add 2 screenshots, one showing the problem. The second with the code modified like mentioned above. |
I can replicate this behaviour on Windows 10 with Emacs 26.1 and 26.2 - it's fine on Arch Linux with both of those versions. I think the markdown-mode type face is being set to Courier as a default which is rendering horribly on my system. Try customising the markdown-mode faces and changing markdown-mode-face to use consolas (or whatever font you are using for editing). After apply and save this dropped the following into my custom.el config: (custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(markdown-code-face ((t (:inherit consolas))))) |
This doesn't appear to render the box/rectangle on the end of each of the symbol lines though - but it does avoid the line wrapping. I also noticed markdown files (.md) have the same awful rendering of code blocks in Emacs on windows and this improved the rendering of those docs. |
This fixed the issue for me. Thank you for the suggestion. |
Same issue with the default emacs theme...and solve with the same solution given by @dsyzling ... |
This fixed an issue for me also |
I was experiencing the same issue and finally have a root cause (thanks to @yyoncho), which was enabled 'indent-guide-mode' together with lsp. When I disabled it, calculation of sideline message placement started working properly, so apparently, lsp-ui-sideline is not taking 'indent-mode' mode into account. |
Hmmm, I just merged #388. Can somebody please test this ? |
I'm new to this issue and lsp-ui in general, but I came across the same issue. I have a version past #388 (version 20200402.839 on melpa). It was fixed by following @dsyzling's comment, although I just the face to inherit from default. I also had the same issue as @chama-chomo and had to disable indent-guide-mode. |
Since 1f3e970 lsp-ui-sideline force the size of the text to be a fixed value. I think that commit fixed the issue, closing |
I'm experiencing this issue in Emacs 27.1 with lsp-ui version 8.0.1 on Ubuntu 22.04, using the Terminus-14 font via (set-face-attribute 'default nil :font "Terminus-14") I was able to fix the problem using a variant of the fix suggested in the comments above, which I got from a reddit post about a similar problem. Here is the variant I used: (custom-set-faces
'(markdown-code-face ((t (:inherit default))))) Please add the fix to the issue description, since many people commented here to say it worked for them. |
Arch Linux amd64 / GNU Emacs 26.2 / lsp-ui 20190428.1045
See screenshot bellow. There is a lot of space at the right side of editor window,
but for some reason
lsp-ui-sideline
insert new line symbols into my code,so code in emacs jump up and down during scrolling.
The text was updated successfully, but these errors were encountered: