]> git.lyx.org Git - lyx.git/blobdiff - src/kbmap.C
form para crash fix from John
[lyx.git] / src / kbmap.C
index 5c97ff3eeb83ca17ac32476db5eb0c4bcf7b69bb..8b528c49f1d046bae6fb066cd8b101b692dcbc66 100644 (file)
@@ -71,7 +71,7 @@ void kb_keymap::printKey(kb_key const & key, string & buf)
 
 
 // This binds a key to an action
-int kb_keymap::bind(string const & seq, int action)
+string::size_type kb_keymap::bind(string const & seq, int action)
 {
        if (lyxerr.debugging(Debug::KBMAP)) {
                lyxerr << "BIND: Sequence `"
@@ -81,8 +81,8 @@ int kb_keymap::bind(string const & seq, int action)
        
        kb_sequence k;
 
-       int const res = k.parse(seq);
-       if (!res) {
+       string::size_type const res = k.parse(seq);
+       if (res == string::npos) {
                defkey(&k, action);
        } else
                lyxerr[Debug::KBMAP] << "Parse error at position " << res