diff --git a/ChangeLog.mkd b/ChangeLog.mkd index 3274102f..5a9204af 100644 --- a/ChangeLog.mkd +++ b/ChangeLog.mkd @@ -2,6 +2,7 @@ - [Open] Escape special characters when open a url (issue #117) - [Open] Recognize "localhost" as valid URL (issue #118) - [Open] Fix open part of the URL you inputed when you input very fast or search very slow (issue #116) +- [Vromerc] Fix can't use Function keys as map key in .Vromerc (issue #109) 1.0.3 (2012/03/06) diff --git a/src/frontend/modules/key-event.js b/src/frontend/modules/key-event.js index 2e692cbf..6d28a6df 100644 --- a/src/frontend/modules/key-event.js +++ b/src/frontend/modules/key-event.js @@ -74,7 +74,7 @@ var KeyEvent = (function() { function filterKey(key, insertMode) { var configure = Settings.get('background.configure'); var mode = insertMode ? 'imap' : 'map'; - if (/\d/.test(key)) { return key; } + if (/^\d$/.test(key)) { return key; } return (configure[mode] && configure[mode][key]) || key; } @@ -128,6 +128,19 @@ var KeyEvent = (function() { var someBindingMatched = true; } } + // TODO Refact me + if ((someBindingMatched == undefined) && !keys.match(/^\d$/)) { + var configure = Settings.get('background.configure'); + var mode = insertMode ? 'imap' : 'map'; + if (configure[mode]) { + for (var i in configure[mode]) { + var regexp = new RegExp('^(' + keys.replace(/([(\[{\\^$|)?*+.])/g,"\\$1") + ')'); + if (regexp.test(i)) { + var someBindingMatched = true; + } + } + } + } // If any function invoked, then store it to last run command. // (Don't do this when run repeat last command or In InsertMode)