#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"
&& 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);
}
}
-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;
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;
}
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();