Remove debug echos
This commit is contained in:
@@ -368,26 +368,18 @@ func highlightStreamPosition2(stream: string, position: int): string =
|
|||||||
else:
|
else:
|
||||||
(position, position)
|
(position, position)
|
||||||
|
|
||||||
|
|
||||||
debugEcho "char: " & $ch
|
|
||||||
debugEcho "position: " & $position
|
|
||||||
|
|
||||||
let startIndex = stream.rfind("\n", 0, lineStartPosition)
|
let startIndex = stream.rfind("\n", 0, lineStartPosition)
|
||||||
let lineStartIndex =
|
let lineStartIndex =
|
||||||
case startIndex:
|
case startIndex:
|
||||||
of -1: 0
|
of -1: 0
|
||||||
else: startIndex + 1
|
else: startIndex + 1
|
||||||
|
|
||||||
debugEcho "startIndex: " & $lineStartIndex
|
|
||||||
|
|
||||||
let endIndex = stream.find("\n", lineEndPosition)
|
let endIndex = stream.find("\n", lineEndPosition)
|
||||||
let lineEndIndex =
|
let lineEndIndex =
|
||||||
case endIndex:
|
case endIndex:
|
||||||
of -1: stream.len
|
of -1: stream.len
|
||||||
else: endIndex
|
else: endIndex
|
||||||
|
|
||||||
debugEcho "endIndex: " & $lineEndIndex
|
|
||||||
|
|
||||||
let spaceChars = " ".repeat((position - lineStartIndex).max(0))
|
let spaceChars = " ".repeat((position - lineStartIndex).max(0))
|
||||||
let lineChars = "_".repeat((lineEndIndex - position).max(0) + 10)
|
let lineChars = "_".repeat((lineEndIndex - position).max(0) + 10)
|
||||||
|
|
||||||
@@ -403,8 +395,6 @@ func highlightStreamPosition2(stream: string, position: int): string =
|
|||||||
of '\n': (lineEndIndex - 1).max(1)
|
of '\n': (lineEndIndex - 1).max(1)
|
||||||
else: lineEndIndex
|
else: lineEndIndex
|
||||||
|
|
||||||
debugEcho "insertMessageAtIndex: " & $insertMessageAtIndex
|
|
||||||
|
|
||||||
let beforeNewline =
|
let beforeNewline =
|
||||||
case (startIndex, ch):
|
case (startIndex, ch):
|
||||||
# Always print newline for newline at the stream begin
|
# Always print newline for newline at the stream begin
|
||||||
@@ -413,6 +403,12 @@ func highlightStreamPosition2(stream: string, position: int): string =
|
|||||||
of (_, '\n'): ""
|
of (_, '\n'): ""
|
||||||
else: "\n"
|
else: "\n"
|
||||||
|
|
||||||
|
# debugEcho "char: " & $ch
|
||||||
|
# debugEcho "position: " & $position
|
||||||
|
# debugEcho "startIndex: " & $lineStartIndex
|
||||||
|
# debugEcho "endIndex: " & $lineEndIndex
|
||||||
|
# debugEcho "insertMessageAtIndex: " & $insertMessageAtIndex
|
||||||
|
|
||||||
stream.dup(insert(&"{beforeNewline}{spaceChars}^{lineChars} Char at \"{escapedChar}\"\n", insertMessageAtIndex))
|
stream.dup(insert(&"{beforeNewline}{spaceChars}^{lineChars} Char at \"{escapedChar}\"\n", insertMessageAtIndex))
|
||||||
|
|
||||||
proc `$`*(x: ParserState): string =
|
proc `$`*(x: ParserState): string =
|
||||||
|
|||||||
Reference in New Issue
Block a user