为什么Sublime Text 2 Ctrl + P在某些项目上不起作用,而它适用于其他项目?
感谢skuroda的提示,点击ctrl + p后登录控制台如下:
command: show_overlay {"overlay": "goto", "show_files": true}
Unable to auto detect encoding, using fallback encoding Western (Windows 1252)
Unable to auto detect encoding, using fallback encoding Western (Windows 1252)
Traceback (most recent call last):
File ".\sublime_plugin.py", line 175, in on_load
callback.__module__, "on_load", EVENT_TIMEOUT)
File ".\sublime_plugin.py", line 154, in run_timed_function
ret = f()
File ".\sublime_plugin.py", line 174, in <lambda>
run_timed_function(lambda: callback.on_load(v),
File ".\sublime_gbk.py", line 51, in on_load
File ".\sublime_gbk.py", line 36, in gbk2utf8
Boost.Python.ArgumentError: Python argument types in
Window.focus_view(Window, NoneType)
did not match C++ signature:
focus_view(class SP<struct edit_window::reference>, class SP<class TextBufferView>)
Traceback (most recent call last):
File ".\sublime_plugin.py", line 175, in on_load
callback.__module__, "on_load", EVENT_TIMEOUT)
File ".\sublime_plugin.py", line 154, in run_timed_function
ret = f()
File ".\sublime_plugin.py", line 174, in <lambda>
run_timed_function(lambda: callback.on_load(v),
File ".\sublime_gbk.py", line 51, in on_load
File ".\sublime_gbk.py", line 36, in gbk2utf8
Boost.Python.ArgumentError: Python argument types in
Window.focus_view(Window, NoneType)
did not match C++ signature:
focus_view(class SP<struct edit_window::reference>, class SP<class TextBufferView>)
答案 0 :(得分:7)
如果没有更多信息,很难提供任何其他帮助。话虽如此,请尝试在控制台ctrl+backtick
或View -> Show Console
上打开。在那里输入sublime.log_commands(True)
。每次点击ctrl+p
时,都应该打印command: show_overlay {"overlay": "goto", "show_files": true}
之类的内容。如果没有,请说明它的作用。此外,您可以通过在控制台中输入sublime.log_input(True)
来验证输入ST是否正在接收。这应该总是返回key evt: control+p
。
希望通过这两个命令,您可以提供一些其他信息。如果/更新时我会适当地编辑我的答案。
编辑:
看起来插件导致了问题。我猜它是sublime-gbk,但我只是在猜测。您可以尝试在开发人员的页面上创建一个问题,并希望它得到解决。我唯一可以建议的是禁用该插件。您也可以尝试修改插件。这可能会破坏某些内容,但在def gbk2utf8(view):
中,您可以执行类似
if view is None:
return
在尝试除块之前。当然,根据需要对齐间距,这样它就是有效的Python。