Fix a message bug.

If a point span appeared past the end of a file, and that file *didn't*
end with a trailing newline, that span would be printed as though it
pointed at the last character of the file.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org//2056913002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cca6f11..d1bcda5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 1.2.3
+
+* Fix a bug where a point span at the end of a file without a trailing newline
+  would be printed incorrectly.
+
 # 1.2.2
 
 * Allow `SourceSpanException.message`, `SourceSpanFormatException.source`, and
diff --git a/lib/src/span_mixin.dart b/lib/src/span_mixin.dart
index 2d390b6..f6d04fa 100644
--- a/lib/src/span_mixin.dart
+++ b/lib/src/span_mixin.dart
@@ -70,7 +70,7 @@
       }
       var endIndex = context.indexOf('\n');
       textLine = endIndex == -1 ? context : context.substring(0, endIndex + 1);
-      column = math.min(column, textLine.length - 1);
+      column = math.min(column, textLine.length);
     } else {
       textLine = text.split("\n").first;
       column = 0;
diff --git a/pubspec.yaml b/pubspec.yaml
index 7ca7de4..3ef97ed 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: source_span
-version: 1.2.2
+version: 1.2.3
 author: Dart Team <misc@dartlang.org>
 description: A library for identifying source spans and locations.
 homepage: https://github.com/dart-lang/source_span
diff --git a/test/file_message_test.dart b/test/file_message_test.dart
index 5935c58..d78a651 100644
--- a/test/file_message_test.dart
+++ b/test/file_message_test.dart
@@ -59,6 +59,15 @@
            ^"""));
   });
 
+  test("works for a point span at the end of the file with no trailing newline",
+      () {
+    file = new SourceFile("zip zap zop");
+    expect(file.location(11).pointSpan().message("oh no"), equals("""
+line 1, column 12: oh no
+zip zap zop
+           ^"""));
+  });
+
   test("works for a point span in an empty file", () {
     expect(new SourceFile("").location(0).pointSpan().message("oh no"),
         equals("""