1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
# This file contains logic for detecting an editor, and for selecting
# the default editor.
init:
python hide:
import os.path
import sys
import platform
if not config.editor:
if sys.platform == 'win32':
editor = config.renpy_base + "/editor/scite.exe"
if os.path.exists(editor):
editor = renpy.shell_escape(editor)
config.editor = '"' + editor + '" "%(allfiles)s" "-open:%(filename)s" -goto:%(line)d'
config.editor_transient = config.editor+' -revert:'
elif platform.mac_ver()[0]:
config.editor = "open -t '%(allfiles)s'"
else:
editor = config.renpy_base + "/editor/scite"
if os.path.exists(editor):
editor = renpy.shell_escape(editor)
config.editor = "'" + editor + "' '%(allfiles)s' '-open:%(filename)s' -goto:%(line)d"
config.editor_transient = config.editor+' -revert:'
if config.editor:
os.environ['RENPY_EDITOR'] = config.editor
if config.editor_transient:
os.environ['RENPY_EDITOR_TRANSIENT'] = config.editor_transient
|