Skip to content

Commit c4c35ff

Browse files
rapus95KristofferC
authored andcommitted
Fixes @less on windows (line off-by-one) (#33587)
Fixes #27017
1 parent 84a4ef1 commit c4c35ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/InteractiveUtils/src/editless.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ edit(m::Module) = edit(pathof(m))
226226
if Sys.iswindows()
227227
function less(file::AbstractString, line::Integer)
228228
pager = shell_split(get(ENV, "PAGER", "more"))
229-
g = pager[1] == "more" ? "" : "g"
229+
if pager[1] == "more"
230+
g = ""
231+
line -= 1
232+
else
233+
g = "g"
234+
end
230235
run(Cmd(`$pager +$(line)$(g) \"$file\"`, windows_verbatim = true))
231236
nothing
232237
end

0 commit comments

Comments
 (0)