Skip to content

Commit

Permalink
fix exception in keymap CTRL+V when calling original + this context f…
Browse files Browse the repository at this point in the history
…or keymaps #351
  • Loading branch information
jcubic committed Oct 25, 2017
1 parent a7cb80d commit 6edeb1d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* fix substring and string like '<a' that was breaking command line
* fix newlines in string when do parse/split _command (used by command line)
* fix split equal and command line splitting

* fix exception in keymap when calling original in the one that was overwriten by terminal like CTRL+V (reported by Ravi Teja Mamidipaka [#351](https://github.com/jcubic/jquery.terminal/issues/351))
* not all keymaps had terminal as this context

## 1.9.0
### Features
Expand Down
10 changes: 6 additions & 4 deletions js/jquery.terminal-1.9.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Mon, 23 Oct 2017 18:53:34 +0000
* Date: Wed, 25 Oct 2017 07:24:40 +0000
*/

/* TODO:
Expand Down Expand Up @@ -6738,11 +6738,13 @@
keymap,
$.omap(settings.keymap || {}, function(key, fn) {
if (!keymap[key]) {
return fn;
return fn.bind(self);
}
return function(e) {
return function(e, original) {
// new keymap function will get default as 2nd argument
return fn(e, keymap[key]);
return fn.call(self, e, function() {
return keymap[key](e, original);
});
};
})
);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-1.9.0.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -6738,11 +6738,13 @@
keymap,
$.omap(settings.keymap || {}, function(key, fn) {
if (!keymap[key]) {
return fn;
return fn.bind(self);
}
return function(e) {
return function(e, original) {
// new keymap function will get default as 2nd argument
return fn(e, keymap[key]);
return fn.call(self, e, function() {
return keymap[key](e, original);
});
};
})
);
Expand Down
10 changes: 6 additions & 4 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Mon, 23 Oct 2017 18:53:34 +0000
* Date: Wed, 25 Oct 2017 07:24:40 +0000
*/

/* TODO:
Expand Down Expand Up @@ -6738,11 +6738,13 @@
keymap,
$.omap(settings.keymap || {}, function(key, fn) {
if (!keymap[key]) {
return fn;
return fn.bind(self);
}
return function(e) {
return function(e, original) {
// new keymap function will get default as 2nd argument
return fn(e, keymap[key]);
return fn.call(self, e, function() {
return keymap[key](e, original);
});
};
})
);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

0 comments on commit 6edeb1d

Please sign in to comment.