Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Commit

Permalink
Fixed bug with array traversal logic in save-all-text fn
Browse files Browse the repository at this point in the history
This logic won't be necessary in Hyper v3 once they get the newest 
xterm.js. BufferLine instances will have the new translateToString 
function.
  • Loading branch information
neil-orans committed Jan 30, 2019
1 parent 559cbb0 commit d788ba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ exports.decorateTerm = (Term, { React, notify }) => {
let char_array;
let line = '';
let non_whitespace_found = false;
for (char_array = term.term._core.buffer.lines._array[line_num].length; char_array >= 0; char_array -= 3) {
for (char_array = term.term._core.buffer.lines._array[line_num].length*3-2; char_array >= 0; char_array -= 3) {
let char = String.fromCharCode(term.term._core.buffer.lines._array[line_num]._data[char_array]);
if ((non_whitespace_found && char == ' ') || (non_whitespace_found && char != ' ')) {
if (non_whitespace_found) {
line = char + line; // first index is actual char
} else if (!non_whitespace_found && char == ' ') {
continue;
Expand Down

0 comments on commit d788ba7

Please sign in to comment.