Skip to content

Commit

Permalink
Fix #6328 (get out of REPL modes with backspace)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobaldassi committed Mar 31, 2014
1 parent 484a467 commit d9b6cdf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,16 @@ function setup_interface(d::REPLDisplay,req,rep;extra_repl_keymap=Dict{Any,Any}[
main_prompt.keymap_func = repl_keymap_func

const mode_keymap = {
'\b' => s->(isempty(s) ? transition(s,main_prompt) : LineEdit.edit_backspace(s) )
'\b' => function (s)
if (isempty(s) || position(LineEdit.buffer(s)) == 0) && LineEdit.mode(s) != main_prompt

This comment has been minimized.

Copy link
@Keno

Keno Mar 31, 2014

Member

The LineEdit.mode(s) != main_prompt is redundant since this keymap is only active for the modes.

This comment has been minimized.

Copy link
@carlobaldassi

carlobaldassi Mar 31, 2014

Author Member

Ah I missed that, will remove.

buf = copy(LineEdit.buffer(s))
transition(s,main_prompt)
LineEdit.state(s,main_prompt).input_buffer = buf
LineEdit.refresh_line(s)
else
LineEdit.edit_backspace(s)
end
end
}

b = Dict{Any,Any}[hkeymap, mode_keymap, LineEdit.history_keymap(hp), LineEdit.default_keymap,LineEdit.escape_defaults]
Expand Down

0 comments on commit d9b6cdf

Please sign in to comment.