把sublime从台式移植来笔记本,按F5开交互突然没反应了。
找了不少帖子,国内有效的解决贴是这个:Sublime插件sublimeREPL快捷键无响应问题。但是没有提到原因。
把这段(旧代码)
"caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "file": "config/Python/Main.sublime-menu"
换成这段(新代码)就行了。具体原因我还在google(查明了,请往下看)
"caption": "Python - RUN current file", "cmd": ["python", "-u", "$file_basename"], "syntax": "Packages/Python/Python.tmLanguage", "extend_env": {"PYTHONIOENCODING": "utf-8"}
--------------------------------------2021/3/10------------
新代码的出处是旧代码里的这个文件"file": "config/Python/Main.sublime-menu"
文件中的一段"caption": "Python - RUN current file"的那段
在stackflow上找到答案了:https:///questions/55198793/cant-run-py-files-by-using-hot-key-in-sublimetext3
原来是因为旧代码里的"run_existing_window_command"被新版本sublime弃用了
It appears that Sublime Text 3 build 3200 has broken the run_existing_window_command command. .... From this directory, if you open SublimeREPL/config/Python/Main.sublime-menu , you'll see a big ole json file that looks something like this:就像上面这张截图 ...Notice that the innermost children key is a list of dictionaries with command s and args . We're going to copy those into the sublime-keymap file and replace the command and args that are already there.
现在直接在sublime_menu里找一段,复制到key binding,开头加上自己要的快捷键 就能直接用了。 就像新代码那样
----------------------------结案----------------------寻找过程小结----------------------------
因为两台电脑都是前几年不同时间装的sublime,一时忽略了版本的问题。
也去找过是不是repl的原因,但repl/config/python/Main.sublime-menu从2015开始就没修改过了:https://github.com/wuub/SublimeREPL/blob/master/config/Python/Main.sublime-menu
|