Stephen Searles 8 years ago
parent d31a5053cf
commit 5bcb8c736a
  1. 2
      acedoc.go
  2. 4
      delta.go

@ -74,7 +74,7 @@ func (d Delta) rows() uint {
}
func (d Delta) cols() uint {
r := d.End.Column - d.Start.Column
r := d.End.Column
return r
}

@ -217,8 +217,8 @@ func (d *Document) validate(dl Delta) error {
lastDlLine := dl.line(dl.nRows() - 1)
if uint(len(lastDlLine)) != dl.End.Column {
return fmt.Errorf("delta has %d chars on the final line, but positions show range of %d chars", len(lastDlLine), dl.End.Column)
if uint(len(lastDlLine)) != dl.cols() {
return fmt.Errorf("delta has %d chars on the final line, but positions show range of %d chars", len(lastDlLine), dl.cols())
}
return nil

Loading…
Cancel
Save