SublimeText encloses lines in white rectangles

后端 未结 14 1495
情深已故
情深已故 2020-12-02 05:37

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

\"enter

相关标签:
14条回答
  • 2020-12-02 06:05

    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

    0 讨论(0)
  • 2020-12-02 06:07

    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

    0 讨论(0)
提交回复
热议问题