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

Editor settings for PlantUML #19

Closed
asbjornu opened this issue Feb 15, 2016 · 7 comments
Closed

Editor settings for PlantUML #19

asbjornu opened this issue Feb 15, 2016 · 7 comments

Comments

@asbjornu
Copy link
Contributor

I'd like to configure tabLength: 2 for language-plantuml, but don't really understand how to configure it. I've tried to create the file plantUml.cson with the following contents:

tabLength: 2
    puml:
        tabLength: 2
    pu:
        tabLength: 2

But it doesn't seem to work. The tab length used is still 4 when I press tab. Do I need to restart Atom for the changes to be applied? This might be related to #16, because I don't really understand the difference between grammar and file extension. Which of those should the config file be named after and which should be used within the config file? I'm confused. 😕

@nirix
Copy link
Owner

nirix commented Feb 15, 2016

The README doesn't really make it clear on how to create a config file.

Open the command palette (Cmd+Shift+P on OS X) and type in Editor Settings: Open Grammar Config and when it pops up press enter.

From there, you can set the tab length. As for file extension configuration:

The options not nested under extensionConfig apply to all PlantUML files, but if you want to change the tab length for a PlantUML with the file extension of .pu for example, then the configuration below will do that:

tabLength: 2
extensionConfig:
  pu:
    tabLength: 4

@nirix nirix closed this as completed Feb 17, 2016
@asbjornu
Copy link
Contributor Author

@nirix Thanks. Doing that, opened a file called plantuml.cson (notice the lowercase u) that looks like this:

tabLength: 2
    puml:
        tabLength: 2
    pu:
        tabLength: 2

But when pressing tab in a .puml file, I still get a 4 space length tab character.

@nirix
Copy link
Owner

nirix commented Feb 17, 2016

Atom is most likely set to use tabs, try this;

tabLength: 2
softTabs: true

@asbjornu
Copy link
Contributor Author

@nirix That didn't help. Do I need to restart Atom for the changes to be applied?

@asbjornu
Copy link
Contributor Author

@nirix I fixed it by reducing the config to:

tabLength: 2

Seems like the puml: and/or pu: sections broke it. Any idea why?

@nirix
Copy link
Owner

nirix commented Feb 19, 2016

The puml: and pu: sections must not have been nested under extensionConfig: like so:

tabLength: 2
extensionConfig:
  puml:
    tabLength: 2
  pu:
    tabLength: 2

@asbjornu
Copy link
Contributor Author

@nirix Yes, that's correct! :)

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

No branches or pull requests

2 participants