Add a user preference to set up a custom text editor for editing text files with the "Edit Source" action in the UI context menu. - An operator TEXT_OT_jump_to_file_at_point has been added. - A custom editor can be set in the user preferences. - A preset has been included for "Visual Studio Code". - When the editor is not set, use Blender's internal editor. Ref !108299.
13 lines
273 B
Python
13 lines
273 B
Python
import bpy
|
|
import platform
|
|
|
|
filepaths = bpy.context.preferences.filepaths
|
|
|
|
filepaths.text_editor_args = "-g $filepath:$line:$column"
|
|
|
|
match platform.system():
|
|
case "Windows":
|
|
filepaths.text_editor = "code.cmd"
|
|
case _:
|
|
filepaths.text_editor = "code"
|