Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Editor observations
-
@omz, it would be nice if editor.open_file(name) could open in a new tab instead of the active tab when called from the tools menu.
The documentation for this method is a bit misleading for me. When I read it I was under the impression I could not pass a absolute file spec as a param, but I could.
Help text:
editor.open_file(name)
Open the file with the given name in the editor.name is just a file name of a script in the library, not an absolute path.
The .py extension can be omitted. The file that is currently open in the editor will automatically be saved.
-
Thanks, that documentation seems to be totally outdated (I think I wrote that before Pythonista even supported creating folders).
-
@omz , is the editor module written in Python? I have been trying to find in the Standard library folder, but can't see it
-
No, it's written entirely in (Objective-)C, though it would be possible to replace it with something based on objc_util.
-
@omz , it's ok. As you mentioned the docs were out of date, was going to look at it and see what new stuff was in there.
-
There is actually a new thing.
editor.open_file()
can take two additional (optional) boolean parameters:editor.open_file(file_path[, new_tab, force_reload])
. Thenew_tab
parameter should be self-explanatory.force_reload
only has an effect whennew_tab
is False, and the given file is already open in the current tab. -
@omz , thanks. They are not named args though. They are positional args. But it works.
-
Yeah, I tend to be a bit lazy with keyword args in C code, I always forget the correct way to parse them… Positional args are a bit easier for me, though I'm trying to improve support for keyword args in new code, especially for functions that take lots of parameters.
-
@omz , LOL. Now I understand the ui interface a little bit better. You need a holiday. I know you don't need the virtues of a consistent prototype interface preached to you, however it does make life a hell of a lot easier for the rest of us 😎
Regardless, they are still small things. Like Apple, for the 1 thing that is that not 100% correct, you have done 1,000 correct and better than correct.