VSCode inline diff peek view doesn't show whitespace difference - visual-studio-code

When I change the indentation, Diff Decorations Gutter shows that this line is modified, and open changes with previous revision shows the whitespace difference.
However, when I click the decoration gutter, there is no diff in peek view. How to show the whitespace diff in peek view?
VSCode version: 1.69.2
My settings:
SCM: Diff Decorations Ignore Trim Whitespace - false
Diff Editor: Ignore Trim Whitespace - false
Decorations Gutter & inline diff peek view
open changes with previous revision

Related

Higlight files which are not from my repository

Sometimes I open files from directories, which are not in my workspace.
Example:
❯ rg 'func newCloud' ..
../talos-cloud-controller-manager/pkg/talos/cloud.go:46:1:func newCloud(config *cloudConfig) (cloudprovider.Interface, error) {
...
Then I open ../talos-cloud-controller-manager/pkg/talos/cloud.go.
Unfortunately there is not immediately visible if a file is from the workspace, or from outside.
Is there a way to highlight it somehow, so that you immediately see that a file does not belong to the current workspace?
In above screenshot there are two small indicators. See "talos", but I would like to have a more visible solution.
I just released a new extension, Highlight Files, to color the tabs and Explorer labels of non-workspace files. I have more to do but in the meantime if you drop a non-workspace file or file open a non-workspace color the tab will get colored lime green.
That color is configurable in your settings.json:
"workbench.colorCustomizations": {
"highlightFiles.nonWorkspaceFiles": "#91ff00", // any hex color you want
// #91ff0060 - last two digits are opacity
}
There are these settings:
Highlight Files > Decorations > Enable: Color (in the Settings UI), default is false
"highlightFiles.decorations.enable.color": true/false in settings.json
The above default is false, so you will have to opt-in to enable the extension and start coloring tab names. You can change the setting at any time and it should take effect immediately.
Highlight Files > Decorations > Enable: Badges (in the Settings UI), default is false
"highlightFiles.decorations.enable.badges": true/false in settings.json
The defaults for colors and badges are false, so you will have to opt-in to enable the extension and start adding badges and colors to tab names. You can change these setting at any time and they should take effect immediately.
Highlight Files > Decorations : Badge (in the Settings UI), default is `!``
"highlightFiles.decorations.badge": string, 1-2 characters
The badge can only be string of 1-2 letters, but unicode works too.
Note that settings.json is not a workspace file and thus is colored. Should I filter out settings.json, keybindings.json, and similar from being colored? [I have filtered them out for now... so they are not colored]

Netbeans 12 "diff window" does not always highlight added or removed spaces in the code

I upgraded Netbenas 8 to Netbeans 12 and now my diff window does not always highlight added or removed spaces in the code.
It does highlight if spaces was added or removed in the middle of the line (after a non space character), and before a non space character.
But it does not highlight when the space was added or removed form the beginning of the line, or at the end of the line. Preceding and trailing spaces change does not get highlighted.
I tried restarting Betbeans - it did not help.
I checked HTML, PHP, TXT source code, all have the same problem.
Is there any config parameter to fix it, or is it a bug?
Navigate to Tools > Options > Miscellaneous > Diff
By default, the checkbox Ignore Leading and Trailing White Space is checked:
Just uncheck the checkbox, then click the OK button. Diff will then report on leading and trailing space differences.

Make VSCode Diff Editor ignore empty line addition/deletions?

I want VSCode to ignore empty lines added/removed from showing up in the diff editor.
I can trigger ignore trailing/leading whitespaces by a toggle on the editor, but it does not seem to work on lines.
Current Diff Editor:

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

With "diffEditor.ignoreTrimWhitespace": false, changes in a diff editor:
With "diffEditor.ignoreTrimWhitespace": true, changes in a diff editor:
With "diffEditor.ignoreTrimWhitespace": true, changes in a normal (non-diff) editor:
How to ignore changes in leading/trailing whitespace in a non-diff editor as well?
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:
true: Ignore leading and trailing whitespace
false: Do not ignore leading and trailing whitespace (default)
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.
Just want to add that if you'd like to quickly toggle ignoring leading/trailing whitespace, you could use the setting "scm.diffDecorationsIgnoreTrimWhitespace": "inherit" and assign a shortcut for toggle.diff.ignoreTrimWhitespace, I'm using Alt+Y for this.
There is a "Show Leading/Trailing Whitespace Differences" button on the top right corner in the diff view.See below image

VSCODE - TAB right after the word not working as expected

vscode:
version - 1.40.2
On a normal text type file, type Hello and hit TAB.
All i want is when i hit tab vscode should register 2/4 spaces (what i have configured in the settings.json for the specific language) not a single space.
HelloTAB
Expected: Hello****|
Actual: Hello*|
Make sure you have unchecked Editor: Detect Indentation. Checking this option will override the Tab Size configuration. E.g. if the opened file has 1 space tab indentation but you have configured a 4 spaces tab indentation - the tab size will be 1 space.
Ctrl + , to open Settings.json
Enter in "spaces" in search
Uncheck Editor: Detect Indentation
Leave Editor: Insert spaces checked if you want to insert actual spaces instead of a tab (i.e. you need to do 4 backspaces if you made a mistake). Or unchecked it if you want to insert actual tabs.
Also, you can check what is the configured tab size for that particular opened file by looking at the bottom right of your editor: