Skip to content

Commit

Permalink
REPL: make paste work in search mode (#29373)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9280bfc)
  • Loading branch information
rfourquet authored and KristofferC committed Feb 11, 2019
1 parent affb165 commit 4197f20
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

searchfunc1, searchfunc2, searchstart, skipfunc = backwards ?
Expand Down

0 comments on commit 4197f20

Please sign in to comment.