summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinz N. Gies <heinz@licenser.net>2015-09-24 01:40:19 +0200
committerHeinz N. Gies <heinz@licenser.net>2015-09-29 08:08:08 +0200
commita08fd03d3f2c3ddd5e5f80361620cf1c1403360a (patch)
tree31a6c8272402fbe619754a032a3b1111614eb27c
parent02a7dc47726a4329c029e01a3d1538fc47814a8d (diff)
Fix sub string highlighting for form positions
-rw-r--r--src/rebar_dialyzer_format.erl11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rebar_dialyzer_format.erl b/src/rebar_dialyzer_format.erl
index 056cbd1..61ee591 100644
--- a/src/rebar_dialyzer_format.erl
+++ b/src/rebar_dialyzer_format.erl
@@ -278,14 +278,11 @@ call_or_apply_to_string(ArgNs, FailReason, SigArgs, SigRet,
end.
form_positions(ArgNs) ->
+ ArgS = form_position_string(ArgNs),
case ArgNs of
- [_] -> "an opaque term as ";
- [_,_|_] -> "opaque terms as "
- end ++ form_position_string(ArgNs) ++
- case ArgNs of
- [_] -> " argument";
- [_,_|_] -> " arguments"
- end.
+ [_] -> fmt("~!^an opaque term as ~!!~s~!^ argument", [ArgS]);
+ [_,_|_] -> fmt("~!^opaque terms as ~!!~s~!^ arguments", [ArgS])
+ end.
%% We know which positions N are to blame;
%% the list of triples will never be empty.