-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
How to deactivate highlighting of trailing whitespace? #4419
Comments
You have to set: (setq-default spacemacs-show-trailing-whitespace nil) |
Thanks tuhdo! How can I find this out myself in future? |
I press |
(setq-default spacemacs-show-trailing-whitespace nil) does not work for me.. I actually have it as:
Any help? |
|
Are there any known workarounds? |
You can alt-x to find 'delete-trailing-whitespace' command. |
For me, on Spacemacs: 0.300.0, Emacs 26.1, |
I would like to know how I can customize the way Spacemacs is indicating the trailing whitespace. It used to be bright blue, now are few updates it became red and I'd like to change it. Is there a customize-group for this? I'm on Spacemacs version "develop fc2aa26" / 0.300.0, Emacs 27.1.50. |
I have different or no colour depending on the current theme, hence it is specified within the themes. You can use M-x |
Not working for me either. I'm using diff-hl mode and when I show the diff (on the vc-diff buffer) it shows the trailing space dots even when I have disabled both variables. Right now I have the following on my user-config section:
And when I check the diff minor-mode configuration (by clicking on it with the mouse) I can see that Show trailing space is checked :( Any hints on what's wrong with my conf? |
@rkachach In the You will see nil. |
Yeah, I can see that it's nil but I don't then understand what value is vc-diff mode is using to have the trailing spaces enabled. |
@rkachach
I want to see whether it shows leading spaces differently. |
do you want me to post the source code where this line is inserted? Note: |
@rkachach Because I suspect you're not reporting a bug. It's an intended feature. |
You first called which delegates to and and The very first line of which sets the Also note the documentation of
This is therefore the intended behaviour. |
I see, is there any way to avoid this behavior? |
@rkachach (advice-add 'vc-diff-finish
:after (lambda (_buffer _message)
(setq-local whitespace-style nil)
(setq-local whitespace-trailing-regexp nil))) |
Thanks. should I added it to the following section?
|
@rkachach |
Still the same issue, this is my config:
|
@rkachach |
@rkachach |
@lebensterben
===========
|
@rkachach |
@lebensterben |
@rkachach |
sure:
|
@rkachach (defun my-vc-diff-finish (buffer messages)
;; The empty sync output case has already been handled, so the only
;; possibility of an empty output is for an async process.
(when (buffer-live-p buffer)
(let ((window (get-buffer-window buffer t))
(emptyp (zerop (buffer-size buffer))))
(with-current-buffer buffer
(and messages emptyp
(let ((inhibit-read-only t))
(insert (cdr messages) ".\n")
(message "%s" (cdr messages))))
(setq-local whitespace-style nil)
(setq-local whitespace-trailing-regexp nil)
(goto-char (point-min))
(when window
(shrink-window-if-larger-than-buffer window)))
(when (and messages (not emptyp))
(message "%sdone" (car messages))))))
(advice-add 'vc-diff-finish :override #'my-vc-diff-finish) A few unrelated stuff: You have c-c++
(c-c++ :variables
c-c++-enable-clang-support t
c-c++-backend 'lsp-clangd) You only need Also, you can comment out (setq show-trailing-whitespace nil)
(setq spacemacs-show-trailing-whitespace nil)
(setq-local whitespace-style nil)
(setq-local whitespace-trailing-regexp nil) They should not have any effect. Otherwise there's something wrong. |
@lebensterben thank you very much for taking time to look into this and for the recommendations. Unfortunately the problem still persists and I still see the "dots" :( |
I'm a bit confused here. Are they still highlighted? |
mmm maybe I didn't explain myself clearly (my bad). My issue is with the "dots" that are shown. If you see the above captures you can see my desired output (without dots). Actually I don't mind if they are highlighted or not, what I'm trying to hide are the dots used to mark the spaces. Sorry about the confusion |
@rkachach |
Ok, thank you very much 👍 |
@rkachach (advice-add 'vc-diff-finish :after (lambda (_buffer _message) (whitespace-mode -1)))
|
@lebensterben it doesn't seem to have any effect. whitespace-mode is still enabled. If I disabled it manually (M-x) then it works. Even in this case, when I re-run the vc-diff manually it seems to be re-enabled again. I think the vc-diff doesn't care about any configuration and always enable the whitespace-mode :( |
@rkachach |
@lebensterben |
Hello, Adding the line :
to the user-config section did work for me. Hope this helps! |
The dots used to mark whitespace in diff-mode are caused by a Spacemacs customization. You can disable it with:
Probably this customization should be removed altogether, since it's incredibly ugly and basically useless. |
I've already tried this, but it had no effect:
The text was updated successfully, but these errors were encountered: