diffvisual-studio-codevscode-git

How to ignore changes in leading/trailing whitespace in a non-diff editor?


With "diffEditor.ignoreTrimWhitespace": false, changes in a diff editor:

enter image description here

With "diffEditor.ignoreTrimWhitespace": true, changes in a diff editor:

enter image description here

With "diffEditor.ignoreTrimWhitespace": true, changes in a normal (non-diff) editor:

enter image description here

How to ignore changes in leading/trailing whitespace in a non-diff editor as well?


Solution

  • For others, your issue has been closed with a fix, see Add option to ignore changes in trim whitespace in quick diff .

    The new setting is:

    SCM: Diff Decorations Ignore Trim Whitespace

    Controls whether leading and trailing whitespace is ignored in Source Control diff gutter decorations.

    Options:

    1. true: Ignore leading and trailing whitespace
    2. false: Do not ignore leading and trailing whitespace (default)
    3. inherit: Inherit from diffEditor.IgnoreTrimWhitespace

    This new setting is working in the Insiders' Build (and so may be out in v1.63) - it only affects whether those scm gutter decorations appear when they are caused by leading or trailing whitespace.