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

helix-view: optionally bypass indent style auto detection #11920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fengalin
Copy link
Contributor

Some code formatting styles are too challenging for the indent style auto detection heuristic.

The indent style for C code in GStreamer should use 2 spaces, but auto detection leads to the followings being used:

This commit adds the language configuration flag auto-detect-indent which defaults to true. When set to false, it bypasses auto detection, always using language defined indent style or DEFAULT_INDENT in last resort.

Some code formatting styles are too challenging for the indent style auto
detection heuristic.

The indent style for C code in [GStreamer] should use 2 spaces, but auto
detection leads to the followings being used:

* [gst.c] -> 2 spaces.
* [gstrtsp.c] -> 1 space.
* [gstrtspsrc.c] -> 4 spaces.

This commit adds the language configuration flag `auto-detect-indent` which
defaults to `true`. When set to `false`, it bypasses auto detection, always
using language defined indent style or `DEFAULT_INDENT` in last resort.

[GStreamer]: https://gitlab.freedesktop.org/gstreamer/gstreamer
[gst.c]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gstreamer/gst/gst.c
[gstrtsp.c]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-good/gst/rtsp/gstrtsp.c
[gstrtspsrc.c]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c
@daedroza
Copy link
Contributor

I'm in favor of this but instead we can also look into improving the auto_detect_indent_style heuristic from something like NMAC427/guess-indent.nvim which is working for me almost perfectly.

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.

2 participants