added :displaysize as chunk option and chunks now respect displaysize

pull/433/head
Tor Erlend Fjelde 2021-08-02 00:09:53 +01:00
parent 381de22c7d
commit b5a0e8652b
2 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,9 @@ const _DEFAULT_PARAMS = Dict{Symbol,Any}(
:term => false,
:prompt => "julia>",
:label => nothing,
:wrap => true,
:wrap => false,
:line_width => 75,
:displaysize => displaysize(),
:fig_ext => nothing,
:fig_pos => nothing,
:fig_env => nothing,

View File

@ -260,7 +260,11 @@ function eval_chunk(doc::WeaveDoc, chunk::CodeChunk, report::Report, mod::Module
chunk.options[:out_width] = report.format.out_width
end
chunk.result = run_code(doc, chunk, report, mod)
# Get the default `displaysize`.
lines, cols = chunk.options[:displaysize]
chunk.result = withenv("LINES" => lines, "COLUMNS" => cols) do
run_code(doc, chunk, report, mod)
end
execute_posthooks!(chunk)