From d1fff6633126ab6af229462b18abcec8435d77d8 Mon Sep 17 00:00:00 2001 From: Qrox Date: Fri, 10 Jan 2020 22:51:45 +0800 Subject: [PATCH] Display unbound key as a red ? instead of an unreplaced tag in the help UI --- src/help.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/help.cpp b/src/help.cpp index ad6796bd85353..27b8ee76a30fd 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -83,9 +83,10 @@ std::string help::get_dir_grid() for( auto dir : movearray ) { std::vector keys = keys_bound_to( dir ); - for( size_t i = 0; i < keys.size(); i++ ) { + for( size_t i = 0; i < 2; i++ ) { movement = string_replace( movement, "<" + action_ident( dir ) + string_format( "_%d>", i ), - string_format( "%s", keys[i] ) ); + i < keys.size() ? string_format( "%s", keys[i] ) + : "?" ); } }