hunk.code_window:           return
           }
           return [n, next]
         })
         .filter(Boolean)
       return invalids.size ? invalids : null
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:         return [child, next]
  
hunk.file_path: src/plugins/schema.js
hunk.type: replace
file: 
  import assert from 'assert'
  import path from 'path'
  import readMetadata from 'read-metadata'
  import { Raw } from '../../../../../..'
  
  export default function (state) {
    const file = path.resolve(__dirname, 'fragment.yaml')
    const raw = readMetadata.sync(file)
    const fragment = Raw.deserialize(raw, { terse: true }).document
  
    const { document, selection } = state
    const texts = document.getTexts()
    const first = texts.first()
    const last = fragment.getTexts().last()
    const range = selection.merge({
      anchorKey: first.key,
      anchorOffset: 2,
      focusKey: first.key,
      focusOffset: 2
    })
  
    const next = state
      .transform()
      .moveTo(range)
      .insertFragment(fragment)
      .apply()
  
    const updated = next.document.getTexts().get(1)
  
    assert.deepEqual(
      next.selection.toJS(),
      range.merge({
        anchorKey: updated.key,
        anchorOffset: last.length,
        focusKey: updated.key,
        focusOffset: last.length
      }).toJS()
    )
  
    return next
  }
  