SublimeText encloses lines in white rectangles
Asked Answered
C

14

124

It's rather annoying and I can't seem to figure out why.

enter image description here

Cerebral answered 27/4, 2012 at 17:0 Comment(0)
K
69

Looks like you have SublimeLinter installed. It highlights errors and warnings.

Kinshasa answered 27/4, 2012 at 17:3 Comment(7)
control + shift + p or cmd + shift + p and type sublimelinter and click the one with disableShorter
in my case it is anaconda pluginAbner
in my case it is pylinterJotting
Note: Anaconda warnings are visible in the status bar, NOT as hover tooltips.Frink
Thanks a lot. It was Anaconda linting which I had to turn off.Dappled
It can be due to Anaconda as well, to disable it, use cmd + shift + p or control + shift + p, in the drop down menu, there will be an option, 'Anaconda: Disable linting on this file'.Protect
In my case it was: "Highlight Duplicates: Toggle Highlighting"Moyer
G
165

If you still have a problem with those solutions suggested above (with anaconda lint):

Disable linting altogether within the user-defined Anaconda settings file, Anaconda.sublime-settings, via the file menu: Sublime > Preferences > Package Settings > Anaconda > Settings – User: When it opens file, just type the following and save it away ;-)

{"anaconda_linting": false}

At least, it fixed my problem. Blessings (a debtor)<><

Gasconade answered 8/9, 2014 at 6:24 Comment(3)
I want to have the linting functionality, I just want it to only highlight what is wrong and/or indicate a mistake in the gutter, not make these annoying boxes around everything.Blowzy
change "anaconda_linter_mark_style": "outline", to "none" and "anaconda_linter_underlines": true, to false - you will still have gutter marks showing errors but not the annoying outlines/underlines >.<Astrakhan
@JamesBurke: I ended up using your suggestion which ended up running linter without the annoying outline/underlines. Here is what my Anaconda.sublime-settings file looks like: {"anaconda_linter_mark_style": "none", "anaconda_linter_underlines":false}Elayne
K
69

Looks like you have SublimeLinter installed. It highlights errors and warnings.

Kinshasa answered 27/4, 2012 at 17:3 Comment(7)
control + shift + p or cmd + shift + p and type sublimelinter and click the one with disableShorter
in my case it is anaconda pluginAbner
in my case it is pylinterJotting
Note: Anaconda warnings are visible in the status bar, NOT as hover tooltips.Frink
Thanks a lot. It was Anaconda linting which I had to turn off.Dappled
It can be due to Anaconda as well, to disable it, use cmd + shift + p or control + shift + p, in the drop down menu, there will be an option, 'Anaconda: Disable linting on this file'.Protect
In my case it was: "Highlight Duplicates: Toggle Highlighting"Moyer
C
43

Disabling Annaconda linting in sublimetext 3 for current file:

  1. Enter command palette by Cntrl + Shift + P or Command + shift + P for Mac OS X
  2. Type Anaconda: Disable linting on this file and hit enter
  3. To re-enable linting Anaconda: Enable linting on this file

Disabling linting persists between sessions.

Source

Complete answered 21/6, 2016 at 4:33 Comment(0)
F
36

You probably can change "anaconda_linter_mark_style" to "none" and keep "anaconda_linter_underlines" as true. This way it'll only put a underscore under errors but not highlight the whole line.

Fibrinolysis answered 1/7, 2015 at 20:23 Comment(1)
Works well, thanks! Entire Anaconda default settings file: github.com/DamnWidget/anaconda/blob/master/…Cymar
B
10

If you don't want to disable SublimeLinter completely, you can set Syntax Specific Preferences. Preferences -> Package Settings -> Sublime Linter -> Settings Syntax Specific User

The preferences is evaluated similar to CSS, it cascades. Think about the most user-specific, syntax-specific rules evaluated last.

E.g: I also do not like the white rectangle, so I opted for fills.

 {
  /*
        Selects the way the lines with errors or warnings are marked; "outline"
        (default) draws outline boxes around the lines, "fill" fills the lines
        with the outline color, and "none" disables all outline styles
        (useful if "sublimelinter_gutter_marks" is set).
    */
    "sublimelinter_mark_style" : "fill",

    /*
        If true, lines with errors or warnings will be filled in with the
        outline color.

        This setting is DEPRECATED and will be ignored in future
        versions. Use "sublimelinter_mark_style" instead. For backwards
        compatibility reasons, this setting overrides "sublimelinter_mark_style"
        if that one is set to "outline", but has no effect if it's set to "none".
    */
    "sublimelinter_fill_outlines": false,

    // If true, lines with errors or warnings will have a gutter mark.
    "sublimelinter_gutter_marks": false,

    // If true, the find next/previous error commands will wrap.
    "sublimelinter_wrap_find": false,
}
Bertine answered 4/5, 2013 at 2:31 Comment(1)
Thanks, the outlines are very annoying.Potoroo
U
7

For Anaconda/Sublime Users

I have Anaconda and the lint function is useful, but out of the box, it is draconian about style. When you hover over the rectangle, it will tell you the number of the rule it is enforcing. You can disable the ones that you feel are unneeded or get in the way as you code.

On Macs:

  1. Go to Preferences | Browse Packages | Anaconda | Anaconda.sublime-settings
  2. Search for "pep8_ignore"
  3. Add the rules you want to remove.

I've put in my list the following rules that remove some of the white space rules that slow me down but keeps the "no tabs" rule.

    "E201",
    "E202",
    "E203",
    "E302",
    "E309",
    "W291",
    "W293",
    "W391"

You'll want to set "translate_tabs_to_spaces": true in your user settings if you go with this list.

Alternatively you can set "pep8" to false to stop it entirely.

Unbowed answered 15/3, 2016 at 11:1 Comment(0)
D
6

If you are using Anaconda plugin (for Python development) this is it's linting functionality - it highlights Python syntax errors and PEP8 violations.

You can disable this feature completely or change the color of this outline by adding some custom rules to your current SublimeText theme:

  1. In Sublime Text menu: Preferences > Browser Packages...
  2. Locate source file of your current theme in opened directory (*.twTheme file with the name corresponding to the one, selected in Preferences > Color Scheme > ...)
  3. Duplicate this file, add another name (for example Tomorrow-my.tmTheme from Tomorrow.tmTheme)
  4. Paste the following code to this newly created theme file, right before </array> tag:

    <dict>
      <key>name</key>
      <string>anaconda Error Outline</string>
      <key>scope</key>
      <string>anaconda.outline.illegal</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#FF4A52</string>
        <key>foreground</key>
        <string>#FFFFFF</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>anaconda Error Underline</string>
      <key>scope</key>
      <string>anaconda.underline.illegal</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#FF0000</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>anaconda Warning Outline</string>
      <key>scope</key>
      <string>anaconda.outline.warning</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#DF9400</string>
        <key>foreground</key>
        <string>#FFFFFF</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>anaconda Warning Underline</string>
      <key>scope</key>
      <string>anaconda.underline.warning</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#FF0000</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>anaconda Violation Outline</string>
      <key>scope</key>
      <string>anaconda.outline.violation</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#ffffff33</string>
        <key>foreground</key>
        <string>#FFFFFF</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>anaconda Violation Underline</string>
      <key>scope</key>
      <string>anaconda.underline.violation</string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#FF0000</string>
      </dict>
    </dict>
    
  5. Adjust the colors to your needs. Save file.
  6. Select your "new" theme in Preferences > Color Scheme > and observe the changes.

Point 3. was needed in my case because color wasn't updated immediately, after just saving theme and restarting Sublime/switching themes (sublime uses some kind of buffer?..). So, maybe you will have to repeat steps 3-6, when you want to play a little with the colors.

Source: Anaconda's Docs

Dihedron answered 8/12, 2014 at 13:6 Comment(0)
R
4

On line 300 "anaconda_linter_mark_style": "none", in Preferences -> Package Settings -> Anaconda -> Settings - Default. This removes the "annoying" highlighting but still checks for pep8 errors

Rodd answered 26/6, 2020 at 10:51 Comment(0)
H
3

If none of the previous solutions worked for you, try this:

  1. Go to Preferences | Package Settings | Pylinter | User settings
  2. In the file, just add/modify the following lines:

    "run_on_save": false,
    "disable_outline": true
    

It worked for me, and in my case I had anaconda only as a folder, associating the python compiler of Sublime to the python compiler (python.exe) present in the anaconda folder.

Hindustan answered 10/5, 2016 at 22:27 Comment(0)
G
2

I just found that this can also randomly happen on the last word that you searched. So if you searched for "integer" for instance. Then all instances of "integer" will have that white square around them.

Gauhati answered 24/7, 2015 at 0:12 Comment(0)
I
2

In Anaconda with Sublime Text, if you don't want to make any changes to the settings:

In the case highlighting occurs, you can use a keyboard shortcut (in my case it's CTRL-ALT-R) to autoformat the code! The highlighting will be gone immediately.

You just have to repeat that every once in a while, after having added new code (which is not formatted according to the PEP8 rules).

The command is "anaconda_auto_format".

Iphlgenia answered 30/9, 2018 at 8:31 Comment(1)
Thank you! this shortcut is magical. Also, if you move the cursor to the highlighted line, you will find an explanation at the bottom bar of SublimeText, stating the PEP8 violation made.Syncrisis
S
1

if you got the anaconda linting

go in the dir like this C:\Users\giova\AppData\Roaming\Sublime Text 3\Packages\Anaconda and change the anaconda.sublime-settings (find the anaconda linter keys and set them to false). See if you installed other linter stuff and change their settings to false where it seems to rely on linting until everythings is right for you. I had installed different linters, so I had to change all of them.

Surroundings answered 13/8, 2018 at 5:18 Comment(0)
C
0

you can disable warnings in anaconda.sublime-settings via the file menu:

Sublime > Preferences > Package Settings > Anaconda > Settings – User:

In opened file type following code and press Ctrl + S to save file

{"pep8": false}

you can also type this:

{"anaconda_linting": false}

but it disables both warnings and errors, which is not good

Corrigible answered 24/9, 2018 at 15:43 Comment(0)
B
0

For me, on sublime 3 this was the PyLinter Package. While the linting feature's useful i also wanted to get rid of the annoying highlight. Found this on their docs if it's helpful! :) https://packagecontrol.io/packages/Pylinter I was able to remove the highlight with Command + option + x

The plugin can be invoked by a keyboard shortcut:

OS X: Command+option+z
Linux, Windows: Control+Alt+z

**Toggle Marking**

The marking of the errors in the file can be toggled off and on:

OS X: Command+option+x
Linux, Windows: Control+Alt+x
Baldhead answered 11/6, 2020 at 20:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.