Skip to content

Commit 9498900

Browse files
timholysimeonschaub
authored andcommitted
Improve inference results in LineEdit
1 parent 01bf160 commit 9498900

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stdlib/REPL/src/LineEdit.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107
# the default mark is 0
108108
getmark(s) = max(0, buffer(s).mark)
109109

110-
const Region = Pair{<:Integer,<:Integer}
110+
const Region = Pair{Int,Int}
111111

112112
_region(s) = getmark(s) => position(s)
113113
region(s) = Pair(extrema(_region(s))...)
@@ -201,7 +201,7 @@ end
201201
beep(::ModeState) = nothing
202202
cancel_beep(::ModeState) = nothing
203203

204-
for f in [:terminal, :on_enter, :add_history, :buffer, :(Base.isempty),
204+
for f in [:terminal, :on_enter, :add_history, :_buffer, :(Base.isempty),
205205
:replace_line, :refresh_multi_line, :input_string, :update_display_buffer,
206206
:empty_undo, :push_undo, :pop_undo, :options, :cancel_beep, :beep,
207207
:deactivate_region, :activate_region, :is_region_active, :region_active]
@@ -2355,10 +2355,11 @@ function run_interface(terminal::TextTerminal, m::ModalInterface, s::MIState=ini
23552355
end
23562356
end
23572357

2358-
buffer(s::PromptState) = s.input_buffer
2359-
buffer(s::SearchState) = s.query_buffer
2360-
buffer(s::PrefixSearchState) = s.response_buffer
2361-
buffer(s::IOBuffer) = s
2358+
buffer(s) = _buffer(s)::IOBuffer
2359+
_buffer(s::PromptState) = s.input_buffer
2360+
_buffer(s::SearchState) = s.query_buffer
2361+
_buffer(s::PrefixSearchState) = s.response_buffer
2362+
_buffer(s::IOBuffer) = s
23622363

23632364
position(s::Union{MIState,ModeState}) = position(buffer(s))
23642365

0 commit comments

Comments
 (0)