Page 1 of 2

Editra + Ren'Py

Posted: Thu Mar 22, 2012 12:02 pm
by PyTom
For those of you who don't know, Editra is an open source text editor, written in Python and using the wxWidgets toolkit and the C++-based Scintilla editing component (the same one used by SciTE).

It was one of the editors I considered back in 2008, as a replacement for SciTE - before I eventually settled on jEdit. The reason for the original decision was largely based on the size of the Ren'Py download. jEdit was a relatively small download, and in 2008 Java was installed on most new computers.

It's 2012, and times have changed. Java is now owned by Oracle, and has some not-so-fun licensing bits. The formerly large size of Editra seems less important now that faster internet connections, and incremental updating of Ren'Py. (Which will be improved in a future Ren'Py release.)

For the last week, I decided to revisit my decision, and see what Editra/Ren'Py integration looks like today. So I've spent the last week taking my old code and bringing it up to date, and this is the result:
editra.png
I've managed to add support for Ren'Py specific syntax highlighting and indenting. Editra with Ren'Py will flag indentation errors, and can optionally flag spelling errors. (You'll need to enable this, and pick your language, in the Preferences.)

I'm leaving on a trip for a couple of days, but I decided to post what I have before I go. So you can download the first release of Editra with Ren'Py from:

http://www.renpy.org/dl/editra/

There isn't any launcher integration, yet - you'll have to take care of opening files by hand. Launcher integration is coming soon, but isn't quite ready yet. The linux versions requires that you have wxpython 2.8 or later and setuptools installed, the Windows and Mac versions are standalone. Editra opens a couple of local-only sockets for remote-control purposes - please let me know if you see a firewall warning because of this.

I'd really like people's feedback on this. My current plan is to eventually distribute Editra alongside Ren'Py, replacing jEdit as the default text editor we ship. So I'd like people to bang on this and make suggestions for how to improve it. If it breaks, please let me know.


Finally, let me point out that all credit for Editra goes to Cody Precord. He's been working on Editra - one of the best cross-platform small editors - for over 7 years now. All I did was to write a plugin for Editra that supports the Ren'Py syntax, using the plugin API he put together.

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 11:45 am
by PyTom
Is there no interest in this?

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 11:53 am
by jack_norton
Sorry, if I wasn't in "crunch mode" I would definitely take a closer look at this. It doesn't have code completion though from what I read?

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 11:55 am
by luminarious
I tried. It didn't colour Ren'py code properly. So I went back to coding with Notepad2 and will later try to make a proper edit file for it.

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 12:13 pm
by PyTom
Is it not selecting Ren'Py mode at all, or is it starting to color and screwing up? When there's a failure like this, I should know about it - since it works for me.

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 12:24 pm
by DragoonHP
Expanding on luminarious problem...

(I think...)The style for Ren'Py is not properly registered with Editra... in the lower right corner, the err... language marker points to Plain Text even though Editra recognises the file as Ren'Py.

And trying to switch to Ren'Py is unsuccessful as it remains in the "Plain Text" mode but switching to Python is successful and the code is coloured again.

Re: Editra + Ren'Py

Posted: Sat Mar 24, 2012 2:05 pm
by Alex
Got not much to say, 'cause I'm an average user...
Tried editra - it highlighted Ren'py code properly for me. And the ability to show whitespaces is a great advantage for my taste (or maybe I just don't know how to set it in Jedit).

Re: Editra + Ren'Py

Posted: Sat Mar 31, 2012 8:37 pm
by winsock
so,why not use notepad++?i think it's a good editor.and it is GPL license.

Re: Editra + Ren'Py

Posted: Sat Mar 31, 2012 8:39 pm
by PyTom
winsock wrote:so,why not use notepad++?i think it's a good editor.and it is GPL license.
It only runs on windows? That pretty much rules it out as the default Ren'Py editor.

I've been writing a bit of code with Editra, and making improvements to it. My hope is to ship it with the June Ren'Py release.

Re: Editra + Ren'Py

Posted: Tue Apr 03, 2012 4:51 pm
by Friendbot2000
I have tested it out and it seems to work for me. As attached as I am to jEdit, Oracle can do some nasty things with licenses if they want to so the move to a open source reliant editor is very wise.

Re: Editra + Ren'Py

Posted: Tue Apr 03, 2012 5:30 pm
by PyTom
I've been using it for a while, and it's not all that great - yet. My current version is improved over the one given above, and it'll be getting better before June.

Re: Editra + Ren'Py

Posted: Wed Apr 04, 2012 11:11 am
by Friendbot2000
If you need someone to test the new improved version PyTom, I have lots of free time on my hands since I got laid off from my job. So far it looks promising :)

Re: Editra + Ren'Py

Posted: Wed Apr 04, 2012 11:27 am
by Friendbot2000
Okay, this is weird. The coloring on the if/else etc statements was there on my laptop, but now that I pull up Editra on my desktop the coloring isnt there. Can anyone else replicate this?

Edit: PyTom, is the module you developed only Ren'Py centric in terms of the color coding? Does Editra color regular Python code?

Edit Edit: Nope, Renpy code is still not color coded on my desktop version of Editra.

Re: Editra + Ren'Py

Posted: Thu Apr 12, 2012 3:30 am
by SleepKirby
I just tried this on my Windows 7 64-bit computer; just extracted the Windows .zip somewhere and opened Editra.exe. I also can't get Ren'Py syntax coloring to work. Coloring other languages like Python and HTML works fine - those syntax highlighting schemes are automatically used when opening .py and .html files respectively. But Ren'Py highlighting doesn't happen for .rpy. Also, I seem to be getting the same behavior as DragoonHP on the bottom-right language indicator.

In Edit -> Preferences -> Document -> Code, the Default Lexer is Ren'Py. I also see that there's a RenPy Color Scheme in Document -> Syntax Highlighting. Not sure what else needs to be in place. Should there be an entry for Ren'Py / .rpy under the Filetype Associations in Document -> Syntax Highlighting? Because I don't see such an entry in there.

Re: Editra + Ren'Py

Posted: Thu Apr 12, 2012 2:34 pm
by PyTom
There should be - I'll take a look at why it isn't showing up.

I'm currently using a much-improved version of this code, which I will make another release of when I get some more experience with it.