Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Aug 13, 2022

Fixes #1203

  • Specify name of editorconfig file so that plugin actually works
  • Link editorconfig plugin and format bar
  • Expose functions to change indent width and style of current document.
  • Make format bar aware if indent width and/or style set by plugin
  • If editorconfig plugin sets indent width and/or style, make the formatbar indent button insensitive.
  • Amend tab button text and tooltip text accordingly
  • Prevent FormatBar changing global settings (this is done via Preferences)
  • Amend .editorconfig file so that it does not duplicate/conflict with global setting of indent width and style.

It was noticed that although indent-width and tab-width are separate properties of SourceView, there is no facility in the existing code for these to be set separately so these are treated the same by the plugin (and only one specified in the config file). If both were specified in a config file then the last one would have priority. If there are situations where these need to be set separately additional code will be required.

There is no facility to update the .editorconfig file through the UI (except by manual editing). That could be added as a future PR if required.

Input required on the user facing copy.

@jeremypw jeremypw requested a review from danirabbit August 13, 2022 12:03
Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this doesn't seem to work for me. When I open an xml file in a project with an editorconfig (such as code) I still get 4 space indent instead of 2

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 2, 2022

@danrabbit It works for me under those circumstances. You have to have

[{*.xml,*.xml.in,*.yml}]
tab_width = 2

in the editor-config file (after the [*] setting)

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 2, 2022

Also you have to install the PR in order to update the plugin - or use the Flatpak version

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 2, 2022

Maybe this is another candidate for moving into the main code?

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, thanks for fixing this!

@danirabbit danirabbit enabled auto-merge (squash) January 12, 2023 00:57
@danirabbit danirabbit merged commit 895cccd into master Jan 12, 2023
@danirabbit danirabbit deleted the honor-editorconfig branch January 12, 2023 00:57
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

Successfully merging this pull request may close these issues.

Editorconfig is no longer respected

3 participants