From 5bcb8c736ad154ad150363de0e49692baaa04ba2 Mon Sep 17 00:00:00 2001 From: Stephen Searles Date: Tue, 13 Jun 2017 09:47:57 -0700 Subject: [PATCH] wip --- acedoc.go | 2 +- delta.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acedoc.go b/acedoc.go index 3de1da1..582b073 100644 --- a/acedoc.go +++ b/acedoc.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 } diff --git a/delta.go b/delta.go index b15b8fb..aa04518 100644 --- a/delta.go +++ b/delta.go @@ -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