Skip to content

Commit

Permalink
Feat: exposing getter setter for widget manager from edit_session cre…
Browse files Browse the repository at this point in the history
…ated using line widgets
  • Loading branch information
nlujjawal committed Nov 14, 2024
1 parent fdc468c commit 7d2a56c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/edit_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class EditSession {
this.$undoSelect = true;
this.$editor = null;
this.prevOp = {};
this.$widgetManager = null;

/** @type {FoldLine[]} */
this.$foldData = [];
Expand Down Expand Up @@ -197,13 +196,14 @@ class EditSession {
* @returns {LineWidgets} object
*/
get widgetManager() {
if(!this.$widgetManager) {
this.$widgetManager = new LineWidgets(this);
const widgetManager = new LineWidgets(this);
// todo remove the widgetManger assignement from lineWidgets constructor when introducing breaking changes
this.widgetManager = widgetManager;

if (this.$editor)
widgetManager.attach(this.$editor);

if (this.$editor)
this.$widgetManager.attach(this.$editor);
}
return this.$widgetManager;
return widgetManager;
}

/**
Expand All @@ -218,7 +218,6 @@ class EditSession {
configurable: true,
value: value,
});
this.$widgetManager = value;
}
/**
* @param {Number} docRow The row to work with
Expand Down

0 comments on commit 7d2a56c

Please sign in to comment.