indentRange Incorrect

Online experience demo:

paste text:

a := 9
b := sga{
  a: "helol",
  b: true,
  c: 2048,
  d: data{
    name:"ak2",
    age:18,
    data: data2{},
  },
  e: [3]int{13,12,23},
}
fmt.Println("Hello, 世界")
fmt.Printf("%v %v ",a ,b)
AAA()
BBB()
CCC()
DDD()

The function I want to achieve is to automatically indent the code area when pasting。I refer to the following link

EditorState.transactionFilter.of(tr => tr.isUserEvent("input.paste") ? [
  tr,
  {changes: indentRange(tr.state, 0, tr.state.doc.length), sequential: true}
] : tr)

Some code areas are indented incorrectly

This commit should make that a bit better.

The patch is helpful. thank you for your dedication