static int getContext_n = 3; static S getContext(S text, int lineNr) { new L l; L lines = toLines(text); int from = max(0, lineNr-1-getContext_n); int to = min(l(lines), lineNr+getContext_n); for (int i = from; i < to; i++) l.add((i == lineNr-1 ? "* " : ". ") + lines.get(i)); ret fromLines(l); }