Clean up logs/comments

This commit is contained in:
Daniel Imms
2017-09-30 08:02:03 -04:00
parent 3e29a03f87
commit 4828c4a6fa
+5 -27
View File
@@ -282,8 +282,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
coords[0]--;
coords[1]--;
console.log('coords', coords);
// Convert viewport coords to buffer coords
coords[1] += this._terminal.buffer.ydisp;
return coords;
@@ -550,14 +548,11 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
if (char[CHAR_DATA_WIDTH_INDEX] === 0) {
// Wide characters aren't included in the line string so decrement the index
charIndex--;
// }
} else if (char[CHAR_DATA_CHAR_INDEX].length > 1) {
console.log('char length > 1', char[CHAR_DATA_CHAR_INDEX], char[CHAR_DATA_CHAR_INDEX].length);
// Emojis take up multiple characters, so adjust accordingly
charIndex += char[CHAR_DATA_CHAR_INDEX].length - 1;
}
}
console.log('character index: ', charIndex);
return charIndex;
}
@@ -616,47 +611,30 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
endCol++;
}
// Expand the string in both directions until a space is hit
let nextCharData = startIndex > 0 ? bufferLine[startCol - 1] : null;
// TODO: Need to make sure that characters whose strings are longer than 1 get compensated for
// Double click words should expand to the spaces.
// while (startIndex > 0 && !this._isCharWordSeparator(line.charAt(startIndex - 1))) {
console.log('start char: ' + bufferLine[startCol]);
console.log('scan backwards');
console.log(' startIndex:',startIndex);
while (startIndex > 0 && !this._isCharWordSeparator(bufferLine[startCol - 1][CHAR_DATA_CHAR_INDEX])) {
const char = bufferLine[startCol - 1];
console.log(' char: ' + char);
if (char[CHAR_DATA_WIDTH_INDEX] === 0) {
// If the next character is a wide char, record it and skip the column
leftWideCharCount++;
startCol--;
} else if (char[CHAR_DATA_CHAR_INDEX].length > 1) {
// If the next character's string is longer than 1 char (eg. emoji),
// adjust the index
startIndex -= char[CHAR_DATA_CHAR_INDEX].length - 1;
console.log('x', char[CHAR_DATA_CHAR_INDEX], char[CHAR_DATA_CHAR_INDEX].length);
}
startIndex--;
startCol--;
}
console.log('scan forwards');
// while (endIndex + 1 < line.length && !this._isCharWordSeparator(line.charAt(endIndex + 1))) {
console.log(' first checking: ',bufferLine[endCol + 1]);
console.log(' endIndex:',endIndex);
console.log(' line:',line);
console.log(' line.length:',line.length);
while (endIndex + 1 < line.length && !this._isCharWordSeparator(bufferLine[endCol + 1][CHAR_DATA_CHAR_INDEX])) {
const char = bufferLine[endCol + 1];
console.log(' char: ' + char);
if (char[CHAR_DATA_WIDTH_INDEX] === 2) {
// If the next character is a wide char, record it and skip the column
rightWideCharCount++;
endCol++;
} else if (char[CHAR_DATA_CHAR_INDEX].length > 1) {
startIndex += char[CHAR_DATA_CHAR_INDEX].length - 1;
// If the next character's string is longer than 1 char (eg. emoji),
// adjust the index
endIndex += char[CHAR_DATA_CHAR_INDEX].length - 1;
}
endIndex++;
endCol++;