Skip to content

Commit

Permalink
REPL: make paste work in search mode (fix #29347)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Sep 26, 2018
1 parent 8d6c1ce commit 3b74735
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ function setup_search_keymap(hp)
# Bracketed paste mode
"\e[200~" => (s,data,c)-> begin
ps = state(s, mode(s))
input = readuntil(ps.terminal, "\e[201~", keep=true)
input = readuntil(ps.terminal, "\e[201~", keep=false)
edit_insert(data.query_buffer, input); update_display_buffer(s, data)
end,
"*" => (s,data,c)->(edit_insert(data.query_buffer, c); update_display_buffer(s, data))
Expand Down
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ function history_search(hist::REPLHistoryProvider, query_buffer::IOBuffer, respo
# FIXME: I'm pretty sure this is broken since it uses an index
# into the search data to index into the response string
b = a + sizeof(searchdata)
b = b  ncodeunits(response_str) ? prevind(response_str, b) : b-1
b = b ncodeunits(response_str) ? prevind(response_str, b) : b-1
b = min(lastindex(response_str), b) # ensure that b is valid

!skip_current && searchdata == response_str[a:b] && return true
Expand Down

0 comments on commit 3b74735

Please sign in to comment.