IPython notebook 3.0 自动关闭括号

IPython notebook 3.0 automatically close brackets

我刚刚下载了新的 IPython 3.0 版本。

笔记本中的某些行为已更改。以前,当我输入一个左括号时,它会自动将其关闭。这在选择文本并通过单击将其括起来时特别有用。

我试过调整~/.ipython/profile_default/static/custom/custom.js

我添加的地方

    if (IPython.CodeCell) {
      IPython.CodeCell.options_default.cm_config.autoCloseBrackets = true;
    }

但这似乎不起作用。

我怎样才能恢复以前的行为?

错误修复正在进行中,可能会在 3.1 中发布,请参阅 this issue

来自 https://github.com/ipython/ipython/issues/7896

” 在 /IPython/html/static/notebook/js/codecell.js 大约第 120 行附近模式:'ipython',在 cm_config 中添加键 autoCloseBrackets: true 选项的确切 name/casing 在 codemirror 手册中的某处。

这对我有用。在第 130 行我添加了:

        autoCloseBrackets: true,

现在它会自动关闭括号。