File: editor.rpy

package info (click to toggle)
renpy 6.6.2.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 8,740 kB
  • ctags: 3,407
  • sloc: python: 22,153; ansic: 3,724; makefile: 138; lisp: 128; sh: 14
file content (37 lines) | stat: -rw-r--r-- 1,314 bytes parent folder | download
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