vim-web 0.3.44-dev.62 → 0.3.44-dev.63

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.
@@ -16,6 +16,10 @@ export declare class Selection<T extends IVimObject> {
16
16
  * If true, reselecting the currently selected single object will toggle it instead of doing nothing.
17
17
  */
18
18
  toggleOnRepeatSelect: boolean;
19
+ /**
20
+ * If true, the selection manager is enabled and can modify the selection.
21
+ */
22
+ enabled: boolean;
19
23
  /**
20
24
  * Creates a new Selection manager.
21
25
  * @param adapter - Adapter responsible for visual selection feedback.
@@ -55248,6 +55248,10 @@ void main() {
55248
55248
  * If true, reselecting the currently selected single object will toggle it instead of doing nothing.
55249
55249
  */
55250
55250
  __publicField(this, "toggleOnRepeatSelect", false);
55251
+ /**
55252
+ * If true, the selection manager is enabled and can modify the selection.
55253
+ */
55254
+ __publicField(this, "enabled", true);
55251
55255
  this._adapter = adapter;
55252
55256
  }
55253
55257
  /**
@@ -55287,6 +55291,7 @@ void main() {
55287
55291
  return Array.isArray(oneOrMore) ? oneOrMore : [oneOrMore];
55288
55292
  }
55289
55293
  select(objectOrObjects) {
55294
+ if (!this.enabled) return;
55290
55295
  if (!objectOrObjects) {
55291
55296
  this.clear();
55292
55297
  return;
@@ -55310,6 +55315,7 @@ void main() {
55310
55315
  this._onSelectionChanged.requestDispatch();
55311
55316
  }
55312
55317
  toggle(objectOrObjects) {
55318
+ if (!this.enabled) return;
55313
55319
  const objects = this.toArray(objectOrObjects);
55314
55320
  let changed = false;
55315
55321
  for (const obj of objects) {
@@ -55328,6 +55334,7 @@ void main() {
55328
55334
  }
55329
55335
  }
55330
55336
  add(objectOrObjects) {
55337
+ if (!this.enabled) return;
55331
55338
  const objects = this.toArray(objectOrObjects);
55332
55339
  let changed = false;
55333
55340
  for (const obj of objects) {
@@ -55342,6 +55349,7 @@ void main() {
55342
55349
  }
55343
55350
  }
55344
55351
  remove(objectOrObjects) {
55352
+ if (!this.enabled) return;
55345
55353
  const objects = this.toArray(objectOrObjects);
55346
55354
  let changed = false;
55347
55355
  for (const obj of objects) {
@@ -55358,6 +55366,7 @@ void main() {
55358
55366
  * Clears the entire selection.
55359
55367
  */
55360
55368
  clear() {
55369
+ if (!this.enabled) return;
55361
55370
  if (this._selection.size === 0) return;
55362
55371
  for (const obj of this._selection) {
55363
55372
  this._adapter.outline(obj, false);