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

EditorConfig Support #35

Open
ghost opened this issue Feb 15, 2020 · 8 comments
Open

EditorConfig Support #35

ghost opened this issue Feb 15, 2020 · 8 comments

Comments

@ghost
Copy link

ghost commented Feb 15, 2020

This would probably be a bit of work, but would certainly be a nice-to-have. I think Qt supports this type of config file as well, so hopefully that'd reduce the required work.

In case anyone is unfamiliar, this is EditorConfig.

@ouuan
Copy link
Contributor

ouuan commented Feb 15, 2020

I think it's easy to use QSettings and apply the settings to the editor by yourself.

@ghost
Copy link
Author

ghost commented Feb 15, 2020

Right, it supports the file format. But why have everyone else implement this feature instead of just adding it to the library?

@ouuan
Copy link
Contributor

ouuan commented Feb 15, 2020

I think you mean providing a preference window, but your application may have a preference window, and it's strange to have two.

@ouuan
Copy link
Contributor

ouuan commented Feb 15, 2020

I think using QSettings is not much harder than calling the responding functions like setTabReplaceSize(), so I believe you mean the preference window.

@ghost
Copy link
Author

ghost commented Feb 15, 2020

I don't mean having a preference window, I just mean a function like this:

QCodeEditor::loadEditorConfig(const char* filename) {
  /* here */
}

The file is not really a user settings file. It's dropped into git repositories to help consistency in the project's indentation style.

@ouuan
Copy link
Contributor

ouuan commented Feb 15, 2020

Oh, is that something like .clang-format? Sorry for that, I didn't read https://editorconfig.org/. However, the name "EditorConfig" is really confusing.

@ouuan
Copy link
Contributor

ouuan commented Feb 15, 2020

So (how) is EditorConfig better than Clang Format?

@ghost
Copy link
Author

ghost commented Feb 15, 2020

Yes, it's very similar to .clang-format. No worries!

I wouldn't say that it's better. I've only ever used clang-format passively, in a formatting script. EditorConfig is usually integrated into a code editor so that it actively maintains the indentations as they are written. I'm sure there's some plugins that support this from a .clang-format file, but I don't really use them.

If there's anything .editorconfig definitely does better than .clang-format, it's that it's much simpler and easier to put into an existing editor. Trying to integrate .clang-format, on the other hand, requires either supporting the many different versions of the clang libraries or implementing all the rules found in the .clang-format file.

knarfS pushed a commit to knarfS/QCodeEditor that referenced this issue Jun 13, 2021
* feat: Press Escape key to cancel select

* Address review comments
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

1 participant