@node-projects/web-component-designer-codeview-monaco 0.1.13 → 0.1.15

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.
@@ -154,7 +154,7 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
154
154
  this._monacoEditor.onDidChangeCursorPosition(e => {
155
155
  const offset = this._monacoEditor.getModel().getOffsetAt(e.position);
156
156
  let debounce = false;
157
- if (this._instanceServiceContainer && debounce) {
157
+ if (this._instanceServiceContainer && !debounce && !this._disableSelection) {
158
158
  debounce = true;
159
159
  this._disableSelection = true;
160
160
  setTimeout(() => {
@@ -187,10 +187,12 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
187
187
  this.code = code;
188
188
  this._instanceServiceContainer = instanceServiceContainer;
189
189
  if (this._monacoEditor) {
190
+ this._disableSelection = true;
190
191
  if (this._monacoEditor)
191
192
  this._monacoEditor.setValue(code);
192
193
  CodeViewMonaco.monacoLib.editor.setModelLanguage(this._monacoEditor.getModel(), this.language);
193
194
  CodeViewMonaco.monacoLib.editor.setTheme(this.theme);
195
+ this._disableSelection = false;
194
196
  }
195
197
  }
196
198
  getText() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "web-component-designer addon: Code Editor using Monaco",
3
3
  "name": "@node-projects/web-component-designer-codeview-monaco",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "type": "module",
6
6
  "main": "./dist/widgets/codeView/code-view-monaco.js",
7
7
  "author": "jochen.kuehner@gmx.de",