mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-23 09:20:05 +00:00
fix enter key workaround. minor. typo.
This commit is contained in:
parent
18d97ce0d7
commit
0eaff0bb07
@ -259,9 +259,7 @@ Program.prototype.listen = function() {
|
||||
}
|
||||
|
||||
if (key.name === 'return' && key.sequence === '\r') {
|
||||
key.name = 'enter';
|
||||
self.input.emit('keypress', ch, key);
|
||||
key.name = 'return';
|
||||
self.input.emit('keypress', ch, merge({}, key, { name: 'enter' }));
|
||||
}
|
||||
|
||||
var name = (key.ctrl ? 'C-' : '')
|
||||
@ -3568,6 +3566,15 @@ function unshiftEvent(obj, event, listener) {
|
||||
});
|
||||
};
|
||||
|
||||
function merge(out) {
|
||||
slice.call(arguments, 1).forEach(function(obj) {
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
out[key] = obj[key];
|
||||
});
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose
|
||||
*/
|
||||
|
@ -893,7 +893,7 @@ Screen.prototype.draw = function(start, end) {
|
||||
}
|
||||
|
||||
if (clr && neq) {
|
||||
lx = ly = -1;
|
||||
lx = -1, ly = -1;
|
||||
if (data !== attr) {
|
||||
out += this.codeAttr(data);
|
||||
attr = data;
|
||||
@ -917,7 +917,7 @@ Screen.prototype.draw = function(start, end) {
|
||||
// supports it. Maybe only try to use ECH here.
|
||||
// //if (this.tput && this.tput.strings.erase_chars)
|
||||
// if (!clr && neq && (xx - x) > 10) {
|
||||
// lx = ly = -1;
|
||||
// lx = -1, ly = -1;
|
||||
// if (data !== attr) {
|
||||
// out += this.codeAttr(data);
|
||||
// attr = data;
|
||||
@ -1860,7 +1860,7 @@ function Element(options) {
|
||||
});
|
||||
|
||||
this.on('detach', function() {
|
||||
delete self._lpos;
|
||||
delete self.lpos;
|
||||
});
|
||||
|
||||
if (options.hoverBg != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user