Skip to content

Commit

Permalink
Merge pull request #186 from bart-d/clientport
Browse files Browse the repository at this point in the history
avoid server warning in case of resize
  • Loading branch information
bart-d authored Apr 11, 2021
2 parents 9fa66a5 + 7e41ed6 commit 6dd3457
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/libtextmode/textmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ function resize_canvas(doc, columns, rows) {
var client = false;
try {
const electron = require("electron");
const win = electron.remote.getCurrentWindow();
client = true;
if (typeof electron == "object") {
const win = electron.remote.getCurrentWindow();
client = true;
}
} catch (err) {
console.log(err);
}
console.log('client: ' + client);
const min_rows = Math.min(doc.rows, rows);
const min_columns = Math.min(doc.columns, columns);
const new_data = new Array(columns * rows);
Expand Down

0 comments on commit 6dd3457

Please sign in to comment.