Skip to content

Commit

Permalink
Fix logic for detecting changed settings for sub-pane.
Browse files Browse the repository at this point in the history
This fixes the (re-opened) issue #29
"the theme doesn't keep if i enable a new tab".
  • Loading branch information
PerBothner committed Mar 2, 2018
1 parent e17936b commit f5b60d3
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions hlib/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function DomTerm(name, topNode) {
sstate.sessionNumber = -1;
sstate.sessionNameUnique = false;
this.windowNumber = -1;
this._settingsCounterInstance = -1;

// Input lines that have not been processed yet.
// In some modes we support enhanced type-ahead: Input lines are queued
Expand Down Expand Up @@ -4579,9 +4580,9 @@ DomTerm.defaultHeight = -1;

DomTerm.prototype.setSettings = function(obj) {
var settingsCounter = obj["##"];
if (DomTerm._settingsCounter == settingsCounter)
if (this._settingsCounterInstance == settingsCounter)
return;
DomTerm._settingsCounter = settingsCounter;
this._settingsCounterInstance = settingsCounter;

this.linkAllowedUrlSchemes = DomTerm.prototype.linkAllowedUrlSchemes;
var link_conditions = "";
Expand Down Expand Up @@ -4627,26 +4628,29 @@ DomTerm.prototype.setSettings = function(obj) {
this.caretStyleFromSettings = -1;
}

var style_user = obj["style.user"];
if (style_user) {
this.loadStyleSheet("user", style_user);
DomTerm._userStyleSet = true;
} else if (DomTerm._userStyleSet) {
this.loadStyleSheet("user", "");
DomTerm._userStyleSet = false;
}
var geom = obj["window.geometry"];
if (geom) {
try {
var m = geom.match(/^([0-9]+)x([0-9]+)$/);
if (m) {
DomTerm.defaultWidth = Number(m[1]);
DomTerm.defaultHeight = Number(m[2]);
}
} catch (e) { }
} else {
DomTerm.defaultWidth = -1;
DomTerm.defaultHeight = -1;
if (DomTerm._settingsCounter != settingsCounter) {
DomTerm._settingsCounter = settingsCounter;
var style_user = obj["style.user"];
if (style_user) {
this.loadStyleSheet("user", style_user);
DomTerm._userStyleSet = true;
} else if (DomTerm._userStyleSet) {
this.loadStyleSheet("user", "");
DomTerm._userStyleSet = false;
}
var geom = obj["window.geometry"];
if (geom) {
try {
var m = geom.match(/^([0-9]+)x([0-9]+)$/);
if (m) {
DomTerm.defaultWidth = Number(m[1]);
DomTerm.defaultHeight = Number(m[2]);
}
} catch (e) { }
} else {
DomTerm.defaultWidth = -1;
DomTerm.defaultHeight = -1;
}
}

if (DomTerm.settingsHook) {
Expand Down

0 comments on commit f5b60d3

Please sign in to comment.