Search code examples
jsonsublimetext3

What are these red arrows and yellow rectangles for on my .json file in Sublime for?


They keep appearing and I don't know why in Sublime Text 3.2.2

Here are two examples:

Yellow Rectangle:

enter image description here

Red Triangles

enter image description here


Solution

  • Those marks in the gutter are the incremental diff functionality that was added to Sublime in build 3200. There are three different marks that can be displayed, though the color of them (and their size) is controlled by your color scheme and so this description may not be entirely accurate depending on what you're using for your color scheme.

    • A red arrow is an indication that one or more lines of text were deleted out of the file at that position in the file.
    • A yellow bar is an indication that the lines that it's covering have been modified in some fashion
    • A green bar is an indication that the lines that it's covering have been added to the file.

    The incremental diff can show you the status of your files based on their status in the git repository (if you're using it and have the feature enabled) and can also show you the same information for changes made to the file since it was originally opened. In the latter case the indicators will be cleared when you close and reopen the file.

    In additional to displaying the location of changes, the incremental diff can also show you exactly what was changed at each point and you can also selectively revert changes, which makes it somewhat like an undo system that lets you undo arbitrary changes.

    For more information you can look at the linked documentation above; There's a video that goes into the incremental diff in more detail here as well if you'd like to know more.