Skip to content

Commit

Permalink
IDEX-3263: Delete prefix mode
Browse files Browse the repository at this point in the history
Delete prefix mode for usual copy and paste text by hotKey in terminal
  • Loading branch information
AndrienkoAleksandr committed Oct 27, 2015
1 parent ef719f1 commit 8f6ed84
Showing 1 changed file with 5 additions and 40 deletions.
45 changes: 5 additions & 40 deletions term.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ function Terminal(options) {
this.normal = null;

// select modes
this.prefixMode = false;
this.selectMode = false;
this.visualMode = false;
this.searchMode = false;
Expand Down Expand Up @@ -2583,24 +2582,15 @@ Terminal.prototype.keyDown = function(ev) {
if (ev.ctrlKey) {
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
// Ctrl-A
if (this.screenKeys) {
if (!this.prefixMode && !this.selectMode && ev.keyCode === 65) {
this.enterPrefix();
return cancel(ev);
}
if (ev.keyCode === 65) {
return;
}
// Ctrl-V
if (this.prefixMode && ev.keyCode === 86) {
this.leavePrefix();
if (ev.keyCode === 86) {
return;
}
// Ctrl-C
if ((this.prefixMode || this.selectMode) && ev.keyCode === 67) {
if (this.visualMode) {
setTimeout(function() {
self.leaveVisual();
}, 1);
}
if (ev.keyCode === 67) {
return;
}
key = String.fromCharCode(ev.keyCode - 64);
Expand Down Expand Up @@ -2634,16 +2624,6 @@ Terminal.prototype.keyDown = function(ev) {

if (!key) return true;

if (this.prefixMode) {
this.leavePrefix();
return cancel(ev);
}

if (this.selectMode) {
this.keySelect(ev, key);
return cancel(ev);
}

this.emit('keydown', ev);
this.emit('key', key, ev);

Expand Down Expand Up @@ -2684,12 +2664,6 @@ Terminal.prototype.keyPress = function(ev) {

key = String.fromCharCode(key);

if (this.prefixMode) {
this.leavePrefix();
this.keyPrefix(ev, key);
return false;
}

if (this.selectMode) {
this.keySelect(ev, key);
return false;
Expand Down Expand Up @@ -4644,17 +4618,8 @@ Terminal.prototype.deleteColumns = function() {
};

/**
* Prefix/Select/Visual/Search Modes
* Select/Visual/Search Modes
*/

Terminal.prototype.enterPrefix = function() {
this.prefixMode = true;
};

Terminal.prototype.leavePrefix = function() {
this.prefixMode = false;
};

Terminal.prototype.enterSelect = function() {
this._real = {
x: this.x,
Expand Down

0 comments on commit 8f6ed84

Please sign in to comment.