Skip to content

Commit

Permalink
Ctrl-1 to show pressed key
Browse files Browse the repository at this point in the history
  • Loading branch information
brookhong committed Mar 9, 2016
1 parent 916575a commit 80ca5ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var Service = (function() {
autoproxy_hosts: {},
proxyMode: 'clear',
proxy: "DIRECT",
interceptedErrors: '',
interceptedErrors: {},
storage: 'local'
};
var newTabUrl = "chrome://newtab/";
Expand Down Expand Up @@ -118,7 +118,7 @@ var Service = (function() {
}
chrome.webRequest.onErrorOccurred.addListener(function(details) {
var tabId = details.tabId;
if (tabId !== -1 && (settings.interceptedErrors === "*" || details.error in settings.interceptedErrors)) {
if (tabId !== -1 && (settings.interceptedErrors.hasOwnProperty("*") || details.error in settings.interceptedErrors)) {
if (!tabErrors.hasOwnProperty(tabId)) {
tabErrors[tabId] = [];
}
Expand Down
6 changes: 1 addition & 5 deletions content_scripts/normal.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,7 @@ var Normal = (function() {
};

self.handleKeyEvent = function(event, key) {
var handled;
if (!this.pendingMap || key.length === 1) {
// actions with extra_chars only works for one char
handled = self._handleMapKey(key);
}
var handled = self._handleMapKey(key);
if (event.keyCode === KeyboardUtils.keyCodes.ESC) {
self.repeats = "";
self.finish();
Expand Down
3 changes: 3 additions & 0 deletions pages/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ mapkey('*', 'Find selected text in current page', function() {
});
mapkey('x', 'Close current tab', 'RUNTIME("closeTab")');
mapkey('X', 'Restore closed tab', 'RUNTIME("openLast")');
mapkey('<Ctrl-1>', 'show pressed key', function(key) {
Normal.showPopup(htmlEncode(key));
}, 1);
mapkey('m', 'Add current URL to vim-like marks', Normal.addVIMark, 1);
mapkey("'", 'Jump to vim-like mark', Normal.jumpVIMark, 1);
mapkey('<<', 'Move current tab to left', function() {
Expand Down

0 comments on commit 80ca5ce

Please sign in to comment.