Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Preferences: an odyssey #284

Open
Zacharias030 opened this issue Feb 8, 2020 · 4 comments
Open

Setting Preferences: an odyssey #284

Zacharias030 opened this issue Feb 8, 2020 · 4 comments

Comments

@Zacharias030
Copy link

@Zacharias030 Zacharias030 commented Feb 8, 2020

How can I define an external editor?

Being new to IPE, I am trying and failing to configure an 'external editor' in order to configure something in a stylesheet in order to move colors from the color picker to the list of symbolic colors in order to be able to generate new objects with that color.

Help is wanted and additionally I will document what I tried as let's say an outsider's perspective and a UX feedback:

Starting point is the Cannot edit stylesheet: No external editor defined message.

Here is what I was looking at to resolve the issue:
0) Why is IPE not defaulting to my system-wide text editor that opens any textfile, which is probably what I want to set anyway?

  1. The menu: none of the dropdown menus mentions 'editor'.
  2. "document properties": It would be weird to set this 'per document', so no surprise it's not here.
  3. Cmd + , : The usual (mac os) cmd+, doesn't bring up any preference pane :/
  4. Help menu: searching for 'editor' without results.
  5. Help -> Show configuration: Here I am informed that no external editor is set. But cannot change it.
    5b) Additionally no preference file is mentioned.
  6. coming here I find #250 ("External Editor") and learn that prefs.external_editor exists.
  7. grepping the docs for prefs. and editor doesn't help, except that I find the env variable EDITOR which I now set to code since this is how I usually open visual studio code from the CL.
  8. restarting IPE obviously didn't help, since I haven't figured out how to start it from the shell. Maybe I could find that in the docs though, but my next step will be to call someone with experience.
@otfried

This comment has been minimized.

Copy link
Owner

@otfried otfried commented Feb 8, 2020

Are you using the lastest version, Ipe 7.2.13? Since 7.2.12 there is a default editor defined on OSX.

Also, Help -> Preferences should give advice on configuring Ipe.

@Zacharias030

This comment has been minimized.

Copy link
Author

@Zacharias030 Zacharias030 commented Feb 8, 2020

Thank you kindly for the help! I was on 7.2.11 and with the new version I got TextEdit as a default, even better would be if it could pick up on my system wide preferences (by MIME type).

Follow up: Setting the editor to code %s seems to work. However, it seems like I need to kill the programs before the 'waiting for ...' message disappears. Can I circumvent that somehow as I have my whole work open in vscode and don't want to terminate the program?

@otfried

This comment has been minimized.

Copy link
Owner

@otfried otfried commented Feb 8, 2020

The setting (in prefs.lua) is

open -W -n -e %s

If I understand the man page correctly, removing the -e flag should cause it to use the application it considers right for the file in question. I don't have a Mac here to try...

The flags -W -n are meant to make the command usable as a setting for $EDITOR (Ipe needs to know when you are done editing). That's why currently you need to terminate the program.
If you figure out a better way of letting Ipe know when you are done editing, please let me know.

@otfried

This comment has been minimized.

Copy link
Owner

@otfried otfried commented Feb 8, 2020

Try using code --wait %s. The call seems to return once the window with the file is closed, without having to close VS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.