MCPcopy Index your code
hub / github.com/chasingboy/Xtools / new_view

Function new_view

xtools.py:583–591  ·  view source on GitHub ↗
(view, edit, text, syntax='', filename='')

Source from the content-addressed store, hash-verified

581
582
583def 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
594def update_file(view, edit, text):

Callers 15

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected