SublimText 用白色矩形包围线条

这很烦人,我也不知道为什么。

enter image description here

69683 次浏览

看起来您已经安装了 圣洁林特。它会突出显示错误和警告。

如果不想完全禁用 SublimLinter,可以设置语法特定首选项。 Preferences -> Package Settings -> Sublime Linter -> Settings Syntax Specific User

首选项的计算类似于 CSS,它级联。

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,
}

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

通过文件菜单,在用户定义的 Anaconda 设置文件 Anaconda.sublim- 设置中完全禁用 linting: 崇高 > 偏好 > 软件包设置 > 水蟒 > 设置-用户: 当它打开文件时,只需键入以下内容并将其保存起来; -)

{“ anaconda _ linting”: false }

至少,它解决了我的问题。 祝福你 (债务人) < >

如果您正在使用 水蟒 plugin (用于 Python 开发) ,这是它的 linting 功能——它突出显示了 Python 语法错误和 PEP8违规。

You can disable this feature completely or 改变颜色 of this outline by adding some custom rules to your current SublimeText theme:

  1. In Sublime Text menu: Preferences > Browser Packages...
  2. 在打开的目录中找到当前主题的源文件(* 。TwTheme 文件,其名称与在 Preferences > Color Scheme > ...中选择的名称相对应
  3. 复制此文件,添加另一个名称(例如 Tomorrow.tmTheme中的 Tomorrow-my.tmTheme)
  4. 将下面的代码粘贴到这个新创建的主题文件中,右边的 之前 </array>标记:

    <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

您可以将 "anaconda_linter_mark_style"改为 "none",并将 "anaconda_linter_underlines"保持为 true。这样,它只会在错误下面加一个下划线,而不会突出显示整行。

我刚刚发现,这也可以随机发生在最后一个词,你搜索。所以如果你搜索“整数”,例如。然后所有的“整数”实例都会有一个白色的正方形围绕在它们周围。

对于蟒蛇/崇高用户

我有 Anaconda 和 lint 函数是有用的,但是开箱即用,它对风格是苛刻的。当您将鼠标悬停在矩形上时,它将告诉您它正在执行的规则的数量。您可以禁用那些您认为不需要的程序,或者阻碍您编写代码。

在 Mac 上:

  1. 进入首选项 | 浏览软件包 | Anaconda | Anaconda.sublim- 设置
  2. 搜索“ pep8 _ 忽略”
  3. 添加要删除的规则。

我在我的列表中加入了以下规则,这些规则删除了一些空白空间规则,这些规则会减慢我的速度,但是保留了“无制表符”规则。

    "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.

或者你可以设置“ pep8”为 false 来完全停止它。

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

  1. 转到首选项 | 包设置 | Pylinter | 用户设置
  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.

在 sublimetext 3中为当前文件禁用 Annaconda linting:

  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. 重新启用衬里 Anaconda: Enable linting on this file

在会话之间持续禁用 linting。

Source

if you got the anaconda linting

像这样进入目录 C: 用户 giova AppData 漫游崇高的文本3包蟒蛇 并更改 anaconda.sublim- 设置(找到 anaconda linter 键并将其设置为 false)。看看你是否安装了其他衬里材料,并改变他们的设置为假,它似乎依赖于衬里,直到一切都适合你。我已经安装了不同的临时工,所以我必须改变他们所有。

you can disable warnings in anaconda.sublime-settings 通过文件菜单:

崇高 > 偏好 > 软件包设置 > 水蟒 > 设置-用户:

在打开的文件类型下面的代码,并按 Ctrl + S保存文件

{"pep8": false}

你也可以输入:

{"anaconda_linting": false}

但它同时禁用警告和错误,这是不好的

如果你不想对设置做任何更改,可以在 Anaconda with SublimeText 中使用:

在突出显示的情况下,您可以使用一个快捷键(在我的例子中是 CTRL-ALT-R)来自动格式化代码!高光会立刻消失。

在添加了新代码(根据 PEP8规则没有进行格式化)之后,您只需要每隔一段时间重复一次。

命令是“ anaconda _ auto _ format”。

对我来说,在崇高3这是 PyLinter 包。虽然灯饰功能是有用的,我也想摆脱恼人的高光。如果有用的话,我在他们的文件里找到了这个!:) Https://packagecontrol.io/packages/pylinter 我能够删除与 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

在第300行“ Anaconda _ linter _ mark _ style”: “ none”,在 Preferences-> Package Settings-> Anaconda-> Settings-Default 中。这消除了“恼人的”突出显示,但仍然检查 pep8错误