UI: Add a custom text editor preference
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.
This commit is contained in:
12
scripts/presets/text_editor/visual_studio_code.py
Normal file
12
scripts/presets/text_editor/visual_studio_code.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user