Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atom-keymap

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atom-keymap - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

57

lib/keymap.js

@@ -34,3 +34,3 @@ (function() {

Keymap.prototype.partialMatchTimeout = 200;
Keymap.prototype.partialMatchTimeout = 1000;

@@ -135,3 +135,3 @@ Keymap.prototype.defaultTarget = null;

Keymap.prototype.handleKeyboardEvent = function(event, replaying) {
var currentTarget, exactMatch, exactMatchCandidates, foundMatch, keystroke, keystrokes, partialMatchCandidates, partialMatches, target, _i, _len, _ref1, _ref2;
var currentTarget, enableTimeout, exactMatch, exactMatchCandidates, foundMatch, keystroke, keystrokes, partialMatchCandidates, partialMatches, target, _i, _len, _ref1, _ref2;
keystroke = this.keystrokeForKeyboardEvent(event);

@@ -151,26 +151,28 @@ if (this.queuedKeystrokes.length > 0 && isAtomModifier(keystroke)) {

partialMatches = this.findPartialMatches(partialMatchCandidates, target);
if (partialMatches.length > 0) {
event.preventDefault();
return this.enterPendingState(partialMatches);
} else {
if (exactMatchCandidates.length > 0) {
currentTarget = target;
while ((currentTarget != null) && currentTarget !== document) {
_ref2 = this.findExactMatches(exactMatchCandidates, currentTarget);
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
exactMatch = _ref2[_i];
foundMatch = true;
this.clearQueuedKeystrokes();
this.cancelPendingState();
if (this.dispatchCommandEvent(exactMatch.command, target, event)) {
return;
}
if (exactMatchCandidates.length > 0) {
currentTarget = target;
while ((currentTarget != null) && currentTarget !== document) {
_ref2 = this.findExactMatches(exactMatchCandidates, currentTarget);
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
exactMatch = _ref2[_i];
foundMatch = true;
if (partialMatches.length > 0) {
break;
}
currentTarget = currentTarget.parentElement;
this.clearQueuedKeystrokes();
this.cancelPendingState();
if (this.dispatchCommandEvent(exactMatch.command, target, event)) {
return;
}
}
currentTarget = currentTarget.parentElement;
}
if (!foundMatch) {
return this.terminatePendingState();
}
}
if (partialMatches.length > 0) {
event.preventDefault();
enableTimeout = foundMatch != null ? foundMatch : this.pendingStateTimeoutHandle != null;
return this.enterPendingState(partialMatches, enableTimeout);
} else {
return this.terminatePendingState();
}
};

@@ -313,5 +315,10 @@

Keymap.prototype.enterPendingState = function(pendingPartialMatches) {
Keymap.prototype.enterPendingState = function(pendingPartialMatches, enableTimeout) {
if (this.pendingStateTimeoutHandle != null) {
this.cancelPendingState();
}
this.pendingPartialMatches = pendingPartialMatches;
return this.pendingStateTimeoutHandle = setTimeout(this.terminatePendingState.bind(this), this.partialMatchTimeout);
if (enableTimeout) {
return this.pendingStateTimeoutHandle = setTimeout(this.terminatePendingState.bind(this), this.partialMatchTimeout);
}
};

@@ -321,3 +328,3 @@

clearTimeout(this.pendingStateTimeoutHandle);
this.pendingStateTimeout = null;
this.pendingStateTimeoutHandle = null;
return this.pendingPartialMatches = null;

@@ -324,0 +331,0 @@ };

{
"name": "atom-keymap",
"version": "0.8.0",
"version": "0.9.0",
"description": "Atom's DOM-aware keymap module",

@@ -5,0 +5,0 @@ "main": "./lib/keymap",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc