This commit is contained in:
2017-06-13 09:47:57 -07:00
parent d31a5053cf
commit 5bcb8c736a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
}
+2 -2
View File
@@ -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