vim-web 0.3.44-dev.78 → 0.3.44-dev.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vim-web.js
CHANGED
|
@@ -60210,7 +60210,7 @@ class StateSynchronizer {
|
|
|
60210
60210
|
this.scheduleUpdate();
|
|
60211
60211
|
}
|
|
60212
60212
|
/**
|
|
60213
|
-
* Reapplies all current state settings, useful after
|
|
60213
|
+
* Reapplies all current state settings, useful after a reconnection.
|
|
60214
60214
|
* This will remove redundant overrides and ensure consistency.
|
|
60215
60215
|
*/
|
|
60216
60216
|
reapplyStates() {
|
|
@@ -60463,16 +60463,29 @@ class StateTracker {
|
|
|
60463
60463
|
* @param toState - The new state to apply
|
|
60464
60464
|
*/
|
|
60465
60465
|
replace(fromState, toState) {
|
|
60466
|
+
this.purge();
|
|
60466
60467
|
if (matchesState(this._default, fromState)) {
|
|
60467
60468
|
this._default = toState;
|
|
60468
60469
|
this._updatedDefault = true;
|
|
60470
|
+
this.reapply();
|
|
60471
|
+
return;
|
|
60469
60472
|
}
|
|
60470
60473
|
for (const [nodeId, state] of this._state.entries()) {
|
|
60471
60474
|
if (matchesState(state, fromState)) {
|
|
60472
60475
|
this._state.set(nodeId, toState);
|
|
60476
|
+
this._updates.add(nodeId);
|
|
60473
60477
|
}
|
|
60474
60478
|
}
|
|
60475
|
-
|
|
60479
|
+
}
|
|
60480
|
+
// Clean up redundant overrides
|
|
60481
|
+
purge() {
|
|
60482
|
+
const toRemove = [];
|
|
60483
|
+
for (const [nodeId, state] of this._state.entries()) {
|
|
60484
|
+
if (state === this._default) {
|
|
60485
|
+
toRemove.push(nodeId);
|
|
60486
|
+
}
|
|
60487
|
+
}
|
|
60488
|
+
toRemove.forEach((nodeId) => this._state.delete(nodeId));
|
|
60476
60489
|
}
|
|
60477
60490
|
}
|
|
60478
60491
|
function matchesState(nodeState, state) {
|