From 914ab70465fbc66c6638b7928e1013cecae00eae Mon Sep 17 00:00:00 2001 From: Blake Johnson Date: Tue, 23 Sep 2014 23:03:03 -0400 Subject: [PATCH] Fix #8446. Provides a universal default action (ignore) when a key cannot be found in the keymap. --- base/LineEdit.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/LineEdit.jl b/base/LineEdit.jl index 91fdea40e71e6..3f15c4a8a5990 100644 --- a/base/LineEdit.jl +++ b/base/LineEdit.jl @@ -731,8 +731,8 @@ function match_input(keymap::Dict, s, cs=Char[]) c = read(terminal(s), Char) push!(cs, c) k = haskey(keymap, c) ? c : '\0' - return match_input(keymap[k], s, cs) - # perhaps better would be: match_input(get(keymap, k, nothing), s, cs) ? + # if we don't match on the key, look for a default action then fallback on 'nothing' to ignore + return match_input(get(keymap, k, nothing), s, cs) end keymap_fcn(f::Nothing, s, c) = (s, p) -> return :ok