Skip to content

Commit

Permalink
Copy input text on tree copy
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-klotho committed Jan 4, 2023
1 parent 41a7377 commit 474e38a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ type Tree struct {
// Copy returns a new copy of a tree
func (t *Tree) Copy() *Tree {
nt := t.p.newTree(C.ts_tree_copy(t.c))
nt.input = t.input
nt.input = make([]byte, len(t.input))
copy(nt.input, t.input)
return nt
}

Expand Down

0 comments on commit 474e38a

Please sign in to comment.