From: Bo Peng Date: Thu, 11 Oct 2007 16:03:21 +0000 (+0000) Subject: InsetInfo: Make the display of multiple shortcuts less clumsy by using A, B instead... X-Git-Tag: 1.6.10~7879 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a412733f65e267dcf4fca7d3543f6f329bbea671;p=features.git InsetInfo: Make the display of multiple shortcuts less clumsy by using A, B instead of [A][B]. This is safe, but a bit contraversial. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20913 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp index 8e4458d485..1a505582a8 100644 --- a/src/KeyMap.cpp +++ b/src/KeyMap.cpp @@ -276,11 +276,18 @@ void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r) docstring const KeyMap::printbindings(FuncRequest const & func) const { - odocstringstream res; Bindings bindings = findbindings(func); - for (Bindings::const_iterator cit = bindings.begin(); - cit != bindings.end() ; ++cit) - res << '[' << cit->print(true) << ']'; + if (bindings.empty()) + return docstring(); + + odocstringstream res; + Bindings::const_iterator cit = bindings.begin(); + Bindings::const_iterator cit_end = bindings.end(); + // prin the first item + res << cit->print(true); + // more than one shortcuts? + for (++cit; cit != cit_end; ++cit) + res << ", " << cit->print(true); return res.str(); }