Skip to content

Commit a378b60

Browse files
committed
rename iosize to displaysize (ref #13825)
1 parent 452f903 commit a378b60

File tree

16 files changed

+38
-38
lines changed

16 files changed

+38
-38
lines changed

base/Terminals.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Base:
2929
flush,
3030
read,
3131
readuntil,
32-
iosize,
32+
displaysize,
3333
start_reading,
3434
stop_reading,
3535
write,
@@ -43,7 +43,7 @@ import Base:
4343
abstract TextTerminal <: Base.IO
4444

4545
# INTERFACE
46-
iosize(::TextTerminal) = error("Unimplemented")
46+
displaysize(::TextTerminal) = error("Unimplemented")
4747
writepos(t::TextTerminal, x, y, s::Array{UInt8,1}) = error("Unimplemented")
4848
cmove(t::TextTerminal, x, y) = error("Unimplemented")
4949
getX(t::TextTerminal) = error("Unimplemented")
@@ -88,8 +88,8 @@ function writepos(t::TextTerminal, x, y, args...)
8888
cmove(t, x, y)
8989
write(t, args...)
9090
end
91-
width(t::TextTerminal) = iosize(t)[2]
92-
height(t::TextTerminal) = iosize(t)[1]
91+
width(t::TextTerminal) = displaysize(t)[2]
92+
height(t::TextTerminal) = displaysize(t)[1]
9393

9494
# For terminals with buffers
9595
flush(t::TextTerminal) = nothing
@@ -158,8 +158,8 @@ disable_bracketed_paste(t::UnixTerminal) = write(t.out_stream, "$(CSI)?2004l")
158158
end_keypad_transmit_mode(t::UnixTerminal) = # tput rmkx
159159
write(t.out_stream, "$(CSI)?1l\x1b>")
160160

161-
function Base.iosize(t::UnixTerminal)
162-
return iosize(t.out_stream)
161+
function Base.displaysize(t::UnixTerminal)
162+
return displaysize(t.out_stream)
163163
end
164164

165165
clear(t::UnixTerminal) = write(t.out_stream, "\x1b[H\x1b[2J")

base/deprecated.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,17 +921,17 @@ export isreadable, iswritable, isexecutable
921921
@deprecate RemoteRef RemoteChannel
922922

923923
function tty_size()
924-
depwarn("tty_size is deprecated. use `iosize(io)` as a replacement", :tty_size)
924+
depwarn("tty_size is deprecated. use `displaysize(io)` as a replacement", :tty_size)
925925
if isdefined(Base, :active_repl)
926926
os = REPL.outstream(Base.active_repl)
927927
if isa(os, Terminals.TTYTerminal)
928-
return iosize(os)
928+
return displaysize(os)
929929
end
930930
end
931931
if isdefined(Base, :STDOUT)
932-
return iosize(STDOUT)
932+
return displaysize(STDOUT)
933933
end
934-
return iosize()
934+
return displaysize()
935935
end
936936

937937
#14335

base/dict.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function showdict{K,V}(io::IO, t::Associative{K,V}; compact = false)
9898
isempty(t) && return
9999
print(io, ":")
100100
if limit
101-
sz = iosize(io)
101+
sz = displaysize(io)
102102
rows, cols = sz[1] - 3, sz[2]
103103
rows < 2 && (print(io, ""); return)
104104
cols < 12 && (cols = 12) # Minimum widths of 2 for key, 4 for value
@@ -158,7 +158,7 @@ function showkv{T<:Union{KeyIterator,ValueIterator}}(io::IO, iter::T)
158158
print(io, ". ", T<:KeyIterator ? "Keys" : "Values", ":")
159159
limit::Bool = limit_output(io)
160160
if limit
161-
sz = iosize(io)
161+
sz = displaysize(io)
162162
rows, cols = sz[1] - 3, sz[2]
163163
rows < 2 && (print(io, ""); return)
164164
cols < 4 && (cols = 4)

base/docs/utils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ end
9494
function repl_search(io::IO, s)
9595
pre = "search:"
9696
print(io, pre)
97-
printmatches(io, s, completions(s), cols = iosize(io)[2] - length(pre))
97+
printmatches(io, s, completions(s), cols = displaysize(io)[2] - length(pre))
9898
println(io, "\n")
9999
end
100100

@@ -243,7 +243,7 @@ end
243243

244244
printmatch(args...) = printfuzzy(STDOUT, args...)
245245

246-
function printmatches(io::IO, word, matches; cols = iosize(io)[2])
246+
function printmatches(io::IO, word, matches; cols = displaysize(io)[2])
247247
total = 0
248248
for match in matches
249249
total + length(match) + 1 > cols && break
@@ -254,9 +254,9 @@ function printmatches(io::IO, word, matches; cols = iosize(io)[2])
254254
end
255255
end
256256

257-
printmatches(args...; cols = iosize(STDOUT)[2]) = printmatches(STDOUT, args..., cols = cols)
257+
printmatches(args...; cols = displaysize(STDOUT)[2]) = printmatches(STDOUT, args..., cols = cols)
258258

259-
function print_joined_cols(io::IO, ss, delim = "", last = delim; cols = iosize(io)[2])
259+
function print_joined_cols(io::IO, ss, delim = "", last = delim; cols = displaysize(io)[2])
260260
i = 0
261261
total = 0
262262
for i = 1:length(ss)
@@ -266,13 +266,13 @@ function print_joined_cols(io::IO, ss, delim = "", last = delim; cols = iosize(i
266266
print_joined(io, ss[1:i], delim, last)
267267
end
268268

269-
print_joined_cols(args...; cols = iosize(STDOUT)[2]) = print_joined_cols(STDOUT, args...; cols=cols)
269+
print_joined_cols(args...; cols = displaysize(STDOUT)[2]) = print_joined_cols(STDOUT, args...; cols=cols)
270270

271271
function print_correction(io, word)
272272
cors = levsort(word, accessible(current_module()))
273273
pre = "Perhaps you meant "
274274
print(io, pre)
275-
print_joined_cols(io, cors, ", ", " or "; cols = iosize(io)[2] - length(pre))
275+
print_joined_cols(io, cors, ", ", " or "; cols = displaysize(io)[2] - length(pre))
276276
println(io)
277277
return
278278
end

base/exports.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ export
11461146
htol,
11471147
hton,
11481148
IOContext,
1149-
iosize,
1149+
displaysize,
11501150
ismarked,
11511151
isopen,
11521152
isreadonly,

base/interactiveutil.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ Print information about exported global variables in a module, optionally restri
430430
The memory consumption estimate is an approximate lower bound on the size of the internal structure of the object.
431431
"""
432432
function whos(io::IO=STDOUT, m::Module=current_module(), pattern::Regex=r"")
433-
maxline = iosize(io)[2]
433+
maxline = displaysize(io)[2]
434434
line = zeros(UInt8, maxline)
435435
head = PipeBuffer(maxline + 1)
436436
for v in sort!(names(m))

base/markdown/render/terminal/render.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
include("formatting.jl")
44

55
const margin = 2
6-
cols(io) = iosize(io)[2]
6+
cols(io) = displaysize(io)[2]
77

88
function term(io::IO, content::Vector, cols)
99
isempty(content) && return

base/pkg/entry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function resolve(
490490
end
491491

492492
function warnbanner(msg...; label="[ WARNING ]", prefix="")
493-
cols = Base.iosize(STDERR)[2]
493+
cols = Base.displaysize(STDERR)[2]
494494
warn(prefix="", Base.cpad(label,cols,"="))
495495
println(STDERR)
496496
warn(prefix=prefix, msg...)

base/profile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function print{T<:Unsigned}(io::IO, data::Vector{T} = fetch(), lidict::Dict = ge
8181
combine = true,
8282
maxdepth::Int = typemax(Int),
8383
sortedby::Symbol = :filefuncline)
84-
cols = Base.iosize(io)[2]
84+
cols = Base.displaysize(io)[2]
8585
if format == :tree
8686
tree(io, data, lidict, C, combine, cols, maxdepth)
8787
elseif format == :flat

base/range.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ function print_range(io::IO, r::Range,
266266
# This function borrows from print_matrix() in show.jl
267267
# and should be called by writemime (replutil.jl) and by display()
268268
limit = limit_output(io)
269-
sz = iosize(io)
269+
sz = displaysize(io)
270270
screenheight, screenwidth = sz[1] - 4, sz[2]
271271
screenwidth -= length(pre) + length(post)
272272
postsp = ""

0 commit comments

Comments
 (0)