From dc59f33ccf4a2075461285fff8fd5c1661bd7f57 Mon Sep 17 00:00:00 2001 From: npezza93 Date: Sat, 27 Jan 2018 22:06:31 -0500 Subject: [PATCH] Fix translateBufferToString bug --- src/Buffer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Buffer.ts b/src/Buffer.ts index 3e7d61224..9d47666f4 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -217,7 +217,10 @@ export class Buffer implements IBuffer { // needed here because some chars are 0 characters long (eg. after wide // chars) and some chars are longer than 1 characters long (eg. emojis). let startIndex = startCol; - endCol = endCol || line.length; + // Only set endCol to the line length when it is null. 0 is a valid column. + if (endCol === null) { + endCol = line.length; + } let endIndex = endCol; for (let i = 0; i < line.length; i++) {