Vscode: Support white-space changes in the gutter change markers

Created on 1 Aug 2016  路  13Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.3.1 (e6b4afa53e9c0f54edef1673de9001e9f0f547ae)
  • OS Version: Linux Mint 18 (Linux 4.4.0-31-generic x86_64 GNU/Linux)
  • Git Version: 2.9.2

Steps to Reproduce:

  1. Init new git repo: git init test && cd test
  2. Create a test file and commit it: echo "Hello" > README.md && git add . && git commit -m "test"
  3. Prepend some spaces: echo " Hello" > README.md
  4. Open in VSCode: code .
  5. Note that README.md is correctly tracked as modified in the Git/VCS tab
  6. Open README.md
  7. Note that the white-space change does not show up in the gutter (.margin-view-overlays)

In this screenshot, I would expect a blue glyph (.git-dirty-modified-diff-glyph) to show up on line 1:

My user settings:

{
    "editor.renderWhitespace": true,
    "editor.tabSize": 2,
    "explorer.openEditors.visible": 0,
    "editor.rulers": [100, 120]
}
*duplicate

Most helpful comment

@alexandrudima What do you think about providing a checkbox to enable/disable whitespace in the diff editor?

All 13 comments

I would actually _prefer_ for whitespace changes not to show up in the Git gutter, at least in some circumstances. So I would like a configurable option to specify whether whitespace changes should or should not be considered in the gutter.

@rmunn Agreed, more config options is always better. I'm coming from Atom/WebStorm, so this behavior threw me off a bit.

@alexandrudima What do you think about providing a checkbox to enable/disable whitespace in the diff editor?

@joaomoreno :+1:

@joaomoreno It would be nice to whitelist the activation for specific file formats, as well. E.g. in YAML or Python files, indentation changes code behavior.

If vscode is going to ignore whitespace changes in the diff view, it should not stage the changes either.

There is a setting for this for the diff editor that seems to work, diffEditor.ignoreTrimWhitespace. Why not the gutter?

@antcodd using this setting worked.

{
  "diffEditor.ignoreTrimWhitespace": false
}

Thank you!

Thanks, @sant123, that works for the Git diff view and is very helpful :) Git gutter still ignores trimmed whitespace, though, so I think keeping this issue open is still valid.

+1
Please add similar to:
"gitGutter.ignoreTrimWhitespace": true/false

Although it is fine to be able to turn this off, the gutter really should he able to show the changes that actually goes into the git commit. I depend on this feature for a couple of the projects I work on as unnecessary changes in indentation clutters the change history.

Actually, the diffEditor.ignoreTrimWhitespace is already working for gutter decorations: https://github.com/Microsoft/vscode/issues/40411

Yes, but this is not about the diff editor, but the editor. This issue is not resolved as of 1.19.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sijad picture sijad  路  3Comments

biij5698 picture biij5698  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments

chrisdias picture chrisdias  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments