]> git.lyx.org Git - features.git/commitdiff
InsetInfo: Make the display of multiple shortcuts less clumsy by using A, B instead...
authorBo Peng <bpeng@lyx.org>
Thu, 11 Oct 2007 16:03:21 +0000 (16:03 +0000)
committerBo Peng <bpeng@lyx.org>
Thu, 11 Oct 2007 16:03:21 +0000 (16:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20913 a592a061-630c-0410-9148-cb99ea01b6c8

src/KeyMap.cpp

index 8e4458d48593caf76cbf5aef41031c4a8a2f2bcf..1a505582a80fc9e18a05f9eb8bd3a6bede671328 100644 (file)
@@ -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();
 }