sublimeREPL快捷键F5无响应问题

把sublime从台式移植来笔记本,按F5开交互突然没反应了。

找了不少帖子,国内有效的解决贴是这个:Sublime插件sublimeREPL快捷键无响应问题。但是没有提到原因。

把这段(旧代码)

{
    "keys": ["f5"],
    "caption": "SublimeREPL: Python - RUN current file",
    "command": "run_existing_window_command",
    "args": {
        "id": "repl_python_run",
        "file": "config/Python/Main.sublime-menu"
    }
},

换成这段(新代码)就行了。具体原因我还在google(查明了,请往下看)

{
    "keys": ["f5"],
    "command": "repl_open",
    "caption": "Python - RUN current file",
    "id": "repl_python_run",
    "mnemonic": "R",
    "args": {
        "type": "subprocess",
        "encoding": "utf8",
        "cmd": ["python", "-u", "$file_basename"],
        "cwd": "$file_path",
        "syntax": "Packages/Python/Python.tmLanguage",
        "external_id": "python",
        "extend_env": {"PYTHONIOENCODING": "utf-8"}
    },
} ,

--------------------------------------2021/3/10------------

新代码的出处是旧代码里的这个文件"file": "config/Python/Main.sublime-menu"

浏览插件目录>sublimerepl  >sublimerepl  >config  >python  >Main.sublime_menu

文件中的一段"caption": "Python - RUN current file"的那段

代码来源

在stackflow上找到答案了:https://stackoverflow.com/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 commands 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

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值