@@ -104,30 +104,31 @@ public String getSnippet() {
104104
105105 // calculate padding for line numbers
106106 int padding = String .valueOf (endLine ).length ();
107+ String pipe = " | " ;
107108
108109 for (int i = startLine ; i <= endLine ; i ++) {
109110 String lineNumStr = String .format ("%" + padding + "d" , i );
110111 String line = lines .get (i - 1 );
111112
112113 // add line
113- sb .append (Colors .GREY ).append (lineNumStr ).append (" | " ).append (line ).append (Colors .RESET ).append ("\n " );
114+ sb .append (Colors .GREY ).append (lineNumStr ).append (pipe ).append (line ).append (Colors .RESET ).append ("\n " );
114115
115116 // add error markers on the line(s) with the error
116117 if (i >= position .lineStart () && i <= position .lineEnd ()) {
117118 int colStart = (i == position .lineStart ()) ? position .colStart () : 1 ;
118119 int colEnd = (i == position .lineEnd ()) ? position .colEnd () : line .length ();
119120
120121 if (colStart > 0 && colEnd > 0 ) {
121- // line number padding + " | " + column offset
122- String indent = " " .repeat (padding ) + Colors .GREY + " | " + Colors .RESET
122+ // line number padding + pipe + column offset
123+ String indent = " " .repeat (padding ) + Colors .GREY + pipe + Colors .RESET
123124 + " " .repeat (colStart - 1 );
124125 String markers = accentColor + "^" .repeat (Math .max (1 , colEnd - colStart + 1 ));
125126 sb .append (indent ).append (markers );
126127
127128 // custom message
128129 if (customMessage != null && !customMessage .isBlank ()) {
129- String sep = " || " ;
130- sb .append (" " + customMessage .replace (sep , "\n " + " " . repeat ( padding + colEnd + sep . length ()) ));
130+ String offset = " " . repeat ( padding + colEnd + pipe . length () + 1 ) ;
131+ sb .append (" " + customMessage .replace ("\n " , " \n " + offset ));
131132 }
132133 sb .append (Colors .RESET ).append ("\n " );
133134 }
0 commit comments