我正在研究Sublime Text 2,并计划对其进行扩展。我使用CTRL'弹出控制台,尝试执行以下操作:
>>> x = window.new_file()
>>> x
<sublime.View object at 0x00000000032EBA70>
>>> x.insert(0,"Hello")
一个新窗口确实打开了,但我的插入似乎不起作用:
Traceback (most recent call last): File "<string>", line 1, in <module> Boost.Python.ArgumentError: Python argument types in
View.insert(View, int, str) did not match C++ signature:
insert(class SP<class TextBufferView>, class SP<class Edit>, __int64, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)
有没有想法我做错了什么?
edit
是一个类型为sublime.Edit
的参数。使用view.begin_edit()
创建它。 - Martijn Pieters