From 69ed78b30f1627897b2e650afb9dfb5bd867b2d3 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 20 Apr 2015 22:02:25 +0200 Subject: msg: Output column numbers starting from 1 Most of editors/IDEs expect column numbers to start from 1, so (1, 1) means beginning of the file. This change applies only to diagnostics output, however Nim will still internally number columns starting from 0. --- compiler/msgs.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 778b839f3..7681b4eb8 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -804,8 +804,11 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, ignoreMsg = optHints notin gOptions or msg notin gNotes frmt = PosHintFormat inc(gHintCounter) + # NOTE: currently line info line numbers start with 1, + # but column numbers start with 0, however most editors expect + # first column to be 1, so we need to +1 here let s = frmt % [toMsgFilename(info), coordToStr(info.line), - coordToStr(info.col), getMessageStr(msg, arg)] + coordToStr(info.col+1), getMessageStr(msg, arg)] if not ignoreMsg and not ignoreMsgBecauseOfIdeTools(msg): msgWriteln(s) if optPrintSurroundingSrc and msg in errMin..errMax: -- cgit 1.4.1-2-gfad0 s log blame commit diff stats
path: root/lib/system/gc_stack.nim
blob: e30d0a7200017194dadeaf17206a5c8dbccbada2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10