diff --git a/M2/Macaulay2/m2/code.m2 b/M2/Macaulay2/m2/code.m2 index ce537a5a0a..f6aecdffb9 100644 --- a/M2/Macaulay2/m2/code.m2 +++ b/M2/Macaulay2/m2/code.m2 @@ -53,19 +53,19 @@ dedupMethods = L -> ( code = method(Dispatch => Thing) code Nothing := identity code FilePosition := x -> ( - filename := x#0; start := x#1; stop := x#3; + filename := x#0; start := x#1; stop := x#3 ?? x#1; ( wp := set characters " \t\r);"; file := ( - if match("startup.m2.in$", filename) then startupString + if match("startup\\.m2\\.in$", filename) then startupString else if filename === "currentString" then ( if currentString === null then error "code no longer available" else currentString) else if filename === "stdio" then ( start = 1; - stop = x#3 - x#1 + 1; - toString stack apply(x#1..x#3, + stop += 1 - x#1; + toString stack apply(x#1..x#1+stop-1, i -> getHistory(i + historyOffset))) else ( if not fileExists filename then error ("couldn't find file ", filename);