diff options
author | Tor Norbye <tnorbye@google.com> | 2012-07-23 15:05:10 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-07-23 15:17:35 -0700 |
commit | db39de536209298ed0c09a0e5aaf69c9df5715d3 (patch) | |
tree | e3806402e216fc1f5c2495872a641aa84abee2c9 /lint/cli | |
parent | 099c517c0d151cfb096c829e95737aa81b81ee1c (diff) | |
download | sdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.zip sdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.tar.gz sdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.tar.bz2 |
Tweaks to the lint CLI offsets
Change-Id: I20592372d41235b36227a0d36014d77c23c7fc58
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index 18a2da0..24c7cda 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -1008,7 +1008,23 @@ public class Main extends LintClient { for (int i = 0; i < column; i++) { sb.append(' '); } - sb.append('^'); + + boolean displayCaret = true; + Position endPosition = location.getEnd(); + if (endPosition != null) { + int endLine = endPosition.getLine(); + int endColumn = endPosition.getColumn(); + if (endLine == line && endColumn > column) { + for (int i = column; i < endColumn; i++) { + sb.append("~"); + } + displayCaret = false; + } + } + + if (displayCaret) { + sb.append('^'); + } sb.append('\n'); warning.errorLine = sb.toString(); } |