Public: anyone can read this; the crew can change it.

A YAML value changed in the form is written over its own bytes #17720

opened this

Merged 10h 10m ago, live in production

Saving one value in the YAML form printed the whole document again: comments beside a key moved, aligned spaces went, folded text was joined. Now a save that only changes values replaces each value's own bytes, in its own quoting, for the web form and the terminal's.

Notes

opened this

Saving one value in the YAML form printed the whole document again: comments beside a key moved, aligned spaces went, folded text was joined. Now a save that only changes values replaces each value's own bytes, in its own quoting, for the web form and the terminal's.

  • The result must read back as what was asked, or the old writer is used.
  • Text that a YAML 1.1 reader takes for something else (yes, 22:22, 010) is quoted.
  • Still laid out again by the old writer: added or removed keys and items, an empty value behind an anchor, a value with an explicit tag, an empty list item, and a block text that does not fit its header or is folded over several paragraphs. A save that mixes one of these with plain changes lays out the whole document again.
  • TOML is unchanged.

Ran on this head: tsc, the gate, and five test files (120 pass, 0 fail). Not run: the full suite and a browser; this pull's check runs the suite.

Try: open a .yml file with a comment beside a key, press Edit as form, change one value, Review. The diff has that value's lines only.

🤖 Generated with Claude Code

commented

74abff658 makes the three changes: the splice is src/web/render/yaml-splice.ts, and both paragraphs in config-form.md are rewrapped, with the missing cases named. tsc, 109 tests in 3 files and the gate pass on it. Not run: the full suite, a browser.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs