Repository navigation
Description
Describe the bug
Inserting/pasting at the end of a YAML document nests/indents the YAML in an unwated way.
In previous versions of Eclipse STS (3.9 and before), I could cut/copy a section of YAML from one document to the other and it would keep the indentation, but in this version it always appears to match the indentation of last non-empty line preceding the target line for paste. This is not at all helpful, because I would never want to nest my properties farther down than they were in the source document, and it means I always need to adjust the indent after pasting, or else insert a dummy character at the desired indent level before pasting (that I then delete after pasting).
It's possible this should be submitted to another repository, but I don't understand Eclipse well enough to know what piece is causing the issue. If it is actually caused by a switch from one component to another, it might be a feature request vs. a bug, but I don't know if it is or not. At a minimum it would be great to have an option to disable this behavior, even though I don't understand why it would ever be desirable.
To Reproduce
Open an application.yml file in a Spring project using STS for Eclipse 5.0.0.RELEASE (also attempted in 4.30), and populate it with two YAML documents - a sample is below.
Try moving top-level properties/section (e.g., logging in the sample) from one document to the bottom of the other document. When pasted, you will see that the properties are now nested beneath the last property in the target document (in the sample, logging becomes nested beneath spring.activemq.pool).
Sample
spring:
debug: false
activemq:
pool:
idle-timeout: 2000
---
my-property: hello
logging:
level:
root: warnWhat I've tried
I've tried making several changes to settings - applying and restarting STS between each.
- Uncheck all language servers in "Language Servers"
- Uncheck "YAML (Wild Web Developer)" -> "Format" -> "Enable/disable default YAML formatter"
- Uncheck "Java" -> "Editor" -> "Typing" -> "When pasting" -> "Adjust indentation"
Activity
BoykoAlex commentedon Dec 22, 2025
@snydergd took me a bit of digging...
So this comes from the TextMate plugin and YAML grammar/language config it seems:
Navigate to the page above. Do you the checkbox Enable indentation rules? If it is unchecked then auto-indent on a new line is gone... Something is off there with the auto-indent I'm guessing
snydergd commentedon Dec 22, 2025
Thank you!
That prevents the indentation behavior I described above for me as well. I see a similar issue posted for JS on the TM4E project: eclipse-tm4e/tm4e#788
Now my question is whether the problem could be with the use of TM4E (maybe compatibility with a related component, or configuration), or if it a bug within TM4E. I feel like simply having the checkbox enabled should be a valid configuration (so it is kind of odd to me that the person opening the issue for JavaScript would be satisfied with that as a "solution"), but this is also really unfamiliar territory for me - maybe for some reason that is the expected/designed behavior for TextMate. I tried adding a configuration for YAML in that screen, copying the built-in file and modifying it, to set random strings for the "next line" options (with the idea that it will never decide to indent), but that did not seem to change anything.
I can always open a new issue on that project, if everything seems to be how it should in this one.