Skip to content

Copy/Pasting YAML results in wrong indentation #226

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

Open
sylr opened this issue Jul 5, 2023 · 10 comments
Open

Copy/Pasting YAML results in wrong indentation #226

sylr opened this issue Jul 5, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@sylr
Copy link

sylr commented Jul 5, 2023

Describe the bug

Copy Pasting yaml when file is identified as GitHub workflow is messed up.

To Reproduce

Screen.Recording.2023-07-05.at.15.53.21.mov

Expected behavior
N/A

Screenshots
N/A

Extension Version
v0.25.8

Additional context
Add any other context about the problem here.

@cschleiden
Copy link
Member

Do you have any YAML auto-formatter installed?

@sylr
Copy link
Author

sylr commented Jul 5, 2023

I do have the redhat.vscode-yaml extension installed.

@KetchupOnMyKetchup
Copy link
Contributor

I see the same behavior where the GitHub workflow doesn't copy/paste the same as a regular YAML file. I don't have another YAML extension installed.

I am on Windows 11 using the desktop version.

GitHub workflow (I noticed I can't find any way to paste it so that it is in the right place with just the paste, I have to do further editing to get it in the right place no matter where I place the cursor to paste):
1

Regular YAML file:
3

@KetchupOnMyKetchup KetchupOnMyKetchup moved this from Backlog 🗒 to Triaged 📝 in GitHub Actions VS Code Extension Jul 13, 2023
@djthornton1212
Copy link

I've experienced the same issue for months as well. It's a shame because I really like what the extension has to offer. I just leave it disabled.

@neil176
Copy link

neil176 commented Dec 14, 2023

I think this may be solved by the following setting

  "[github-actions-workflow]": {
    "editor.autoIndent": "keep"
  }

I spent some time tinkering with this incorrectly for the "[yaml]" settings group, not realizing that "[github-actions-workflow]" is considered a separate language. Does this work for others?

@djthornton1212
Copy link

@neil176 Thank you! That fixed this for me as well.

@Lekshmisr26
Copy link

"[github-actions-workflow]": {
    "editor.autoIndent": "keep"
  }

where to add this

@muzimuzhi
Copy link
Contributor

@Lekshmisr26 In the VScode setting file settings.json, see https://code.visualstudio.com/docs/getstarted/settings#_settingsjson.

@danielniccoli
Copy link

Same awful experience here. The first line of a pasted block has the indentation always changed wrong, while the rest of the YAML block stays as is. I don't have any YAML-related extension active. I use YAML only in GitHub workflows.

@muzimuzhi
Copy link
Contributor

Same awful experience here. The first line of a pasted block has the indentation always changed wrong, while the rest of the YAML block stays as is.

I find an Undo (Cmd/Ctrl + Z) after pasting helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Triaged 📝
Development

No branches or pull requests

8 participants