wip
This commit is contained in:
@@ -74,7 +74,7 @@ func (d Delta) rows() uint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d Delta) cols() uint {
|
func (d Delta) cols() uint {
|
||||||
r := d.End.Column - d.Start.Column
|
r := d.End.Column
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ func (d *Document) validate(dl Delta) error {
|
|||||||
|
|
||||||
lastDlLine := dl.line(dl.nRows() - 1)
|
lastDlLine := dl.line(dl.nRows() - 1)
|
||||||
|
|
||||||
if uint(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.End.Column)
|
return fmt.Errorf("delta has %d chars on the final line, but positions show range of %d chars", len(lastDlLine), dl.cols())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user