]> git.lyx.org Git - lyx.git/blobdiff - src/KeyMap.cpp
Limit the nopassthurchars case in beamer to URL
[lyx.git] / src / KeyMap.cpp
index b4a87d227c911881544b4b59db6e52cc072c7940..8552d7cd44e0c31fdd4de33d7ac6483ac0f8a257 100644 (file)
 
 #include "KeySequence.h"
 #include "LyXAction.h"
-#include "Lexer.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/Lexer.h"
 #include "support/lstrings.h"
 #include "support/TempFile.h"
 
@@ -203,7 +203,7 @@ FuncRequest KeyMap::getBinding(KeySequence const & seq, unsigned int r)
                    && mod1 == it->mod.first
                    && mod2 == it->mod.second) {
                        if (r + 1 == seq.length())
-                               return it->func;
+                               return (it->prefixes) ? FuncRequest::prefix : it->func;
                        else if (it->prefixes)
                                return it->prefixes->getBinding(seq, r + 1);
                }
@@ -218,9 +218,10 @@ void KeyMap::clear()
 }
 
 
-bool KeyMap::read(string const & bind_file, KeyMap * unbind_map, BindReadType rt)
+bool KeyMap::read(string const & bind_file, KeyMap * unbind_map, BindReadType rt, bool i18n)
 {
-       FileName bf = i18nLibFileSearch("bind", bind_file, "bind");
+       FileName bf = i18n ? i18nLibFileSearch("bind", bind_file, "bind")
+                          : libFileSearch("bind", bind_file, "bind");
        if (bf.empty()) {
                if (rt == MissingOK)
                        return true;
@@ -383,8 +384,14 @@ KeyMap::ReturnValues KeyMap::readWithoutConv(FileName const & bind_file, KeyMap
                                error = true;
                                break;
                        }
-                       string const tmp = lexrc.getString();
-                       error |= !read(tmp, unbind_map);
+                       string tmp = lexrc.getString();
+                       if (prefixIs(tmp, "../")) {
+                               tmp = split(tmp, '/');
+                               // look in top dir
+                               error |= !read(tmp, unbind_map, Default, false);
+                       } else
+                               // i18n search
+                               error |= !read(tmp, unbind_map);
                        break;
                }
 
@@ -450,8 +457,7 @@ FuncRequest const & KeyMap::lookup(KeySymbol const &key,
                        if (cit->prefixes) {
                                // this is a prefix key - set new map
                                seq->curmap = cit->prefixes.get();
-                               static const FuncRequest prefix(LFUN_COMMAND_PREFIX);
-                               return prefix;
+                               return FuncRequest::prefix;
                        } else {
                                // final key - reset map
                                seq->reset();