Integrating a custom text editor

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Integrating a custom text editor

#1 Post by vlint »

I have a customized version of SciTE I would like to use instead of the default. However, I can't seem to get shift+E to work properly (even with the default editor). I'm using Linux (Xubuntu), if that makes a difference.

Do you have some example script for how to configure this? The manual doesn't give a full out example, it seems:
http://www.renpy.org/wiki/renpy/doc/ref ... oper_Tools

I tried setting config.editor to True, but that produced errors. I'm not sure of the syntax on this one for setting an editor and such. Anyone else know?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Integrating a custom text editor

#2 Post by PyTom »

Basically, you want to set the following:

Code: Select all

init:
    config.editor = "'/path/to/scite' '%(allfiles)s' '-open:%(filename)s' -goto:%(line)d"
    config.editor_transient = config.editor+' -revert:'
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Re: Integrating a custom text editor

#3 Post by vlint »

Thank you very much for the info! I'll try it out.

Hrmm. I tried it out. It opens the editor, but then it closed again.
I get the following message in the console:
scite: symbol lookup error: /usr/lib/libcairo.so.2: undefined symbol: FT_Library_SetLcdFilter

Any idea why SciTE closes right after it opens and what the error means? I'm using Xubuntu, if that makes a difference.

Am I supposed to change anything in the code other than the path to scite?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Integrating a custom text editor

#4 Post by PyTom »

I think the problem is because we ship a different version of freetype then your cairo expects. The solution is to create the file scite.sh containing:

Code: Select all

unset LD_LIBRARY_PATH
exec /path/to/my/scite "$@"
chmod +x scite.sh, then use it instead of scite directly.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Re: Integrating a custom text editor

#5 Post by vlint »

PyTom wrote:

Code: Select all

unset LD_LIBRARY_PATH
exec /path/to/my/scite "$@"
chmod +x scite.sh, then use it instead of scite directly.
Ah, it works quite nicely. Thanks for the help. I'm impressed.

Hmm, now I just need to figure out how to make it so it uses the same instance of scite all the time, but that's a scite issue, I think, if it opens a new tab instead, at least. Is it possible to reload the file at the line, rather than opening a new scite instance? I know that's hoping, but I it's worth asking, I guess. This is still extremely useful, by the way.

Thanks!

P.S.
For those reading this and following along, put the path to the new scite.sh in the config file. This might sound a little redundant to most people.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Integrating a custom text editor

#6 Post by PyTom »

I had to patch scite to support this, it won't support it out of the box. You can grab my patch from:

http://www.bishoujo.us/svn/scite/trunk/ ... mand.patch
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Re: Integrating a custom text editor

#7 Post by vlint »

PyTom wrote:I had to patch scite to support this
How do I use the patch? Also, do I need to build scite?

vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Re: Integrating a custom text editor

#8 Post by vlint »

Would switching out the executables work? i.e. going into Ren'Py's SciTE and just copying that one over the one I have in /usr/bin/, leaving the stuff in /usr/share untouched.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Integrating a custom text editor

#9 Post by PyTom »

hm... not sure. I seem to recall I disabled most of the non-Ren'Py modes in the Ren'Py scite, leaving in only Ren'Py, Python, C, and HTML.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

vlint
Regular
Posts: 115
Joined: Tue Oct 09, 2007 7:44 pm
Contact:

Re: Integrating a custom text editor

#10 Post by vlint »

Hmm, I tried using the Ren'Py scite executable. It automatically ran with the properties of my system's SciTE, interestingly. Adjusting the path to this didn't keep it with a single instance, though.

Hmm, I tried a few more things. It works, now!

I didn't delete my SciTE, though; I just changed the path to scite in scite.sh to Ren'Py's, and . . . I did something else: I had to make sure
check.if.already.open=1
was set in my SciTE's Global properties, since it seems to ignore how it is already set in the Ren'Py SciTE properties some odd reason.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot]