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

YAML indentation #6661

Closed
antoyo opened this issue Apr 8, 2023 · 1 comment · Fixed by #6768
Closed

YAML indentation #6661

antoyo opened this issue Apr 8, 2023 · 1 comment · Fixed by #6768
Assignees
Labels
A-indent Area: Indentation C-bug Category: This is a bug

Comments

@antoyo
Copy link
Contributor

antoyo commented Apr 8, 2023

Summary

It seems the auto-indent doesn't work for YAML.

I would expect helix to indent when a line containing : and keep the same indent as the previous line otherwise.

Reproduction Steps

I tried this:

  1. hx file.yml
  2. Open a new line.

I expected this to happen:
the new line should be indented.

Instead, this happened:
the new line starts at character 0.

Helix log

~/.cache/helix/helix.log
2023-04-08T15:51:30.050 helix_view::editor [ERROR] Failed to initialize the LSP for `source.yaml` { cannot find binary path }

Platform

Linux

Terminal Emulator

alacritty 0.12.0 (5a728195)

Helix Version

helix 23.03

@antoyo antoyo added the C-bug Category: This is a bug label Apr 8, 2023
@dead10ck
Copy link
Member

dead10ck commented Apr 9, 2023

I'll take this one on; I've been meaning to fix this anyway, since it bugs me regularly. I actually am not sure there are many, if any, situations where we don't just want to carry the current indentation level to the next line. Maybe for less common cases like | and > strings, or for multi line maps/lists explicitly denoted with {} / [].

@dead10ck dead10ck self-assigned this Apr 9, 2023
dead10ck added a commit to dead10ck/helix that referenced this issue Apr 15, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Apr 15, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue May 1, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jun 14, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jun 15, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jun 15, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jun 19, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jun 25, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Jul 19, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
dead10ck added a commit to dead10ck/helix that referenced this issue Aug 1, 2023
This makes use of the new `extend` capture to
correct YAML indentation.

Fixes helix-editor#6661
@pascalkuthe pascalkuthe added the A-indent Area: Indentation label Aug 4, 2023
dead10ck added a commit to dead10ck/helix that referenced this issue Aug 4, 2023
YAML indents queries are tweaked to fix auto indent behavior.

A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.

Fixes helix-editor#6661
archseer pushed a commit that referenced this issue Aug 10, 2023
YAML indents queries are tweaked to fix auto indent behavior.

A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.

Fixes #6661
dgkf pushed a commit to dgkf/helix that referenced this issue Jan 30, 2024
YAML indents queries are tweaked to fix auto indent behavior.

A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.

Fixes helix-editor#6661
mtoohey31 pushed a commit to mtoohey31/helix that referenced this issue Jun 2, 2024
YAML indents queries are tweaked to fix auto indent behavior.

A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.

Fixes helix-editor#6661
smortime pushed a commit to smortime/helix that referenced this issue Jul 10, 2024
YAML indents queries are tweaked to fix auto indent behavior.

A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.

Fixes helix-editor#6661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indent Area: Indentation C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants