(view, edit, text, syntax='', filename='')
| 581 | |
| 582 | |
| 583 | def new_view(view, edit, text, syntax='', filename=''): |
| 584 | new_view = view.window().new_file(syntax=syntax) |
| 585 | new_view.set_scratch(True) |
| 586 | new_view.set_name(filename) |
| 587 | # 旧版本 Sublime Text |
| 588 | # new_view.insert(edit, 0, text.strip()) |
| 589 | # 新版本 Sublime Text |
| 590 | new_view.run_command('insert', {'characters': text.strip()}) |
| 591 | view.window().focus_view(new_view) |
| 592 | |
| 593 | |
| 594 | def update_file(view, edit, text): |