@jupyterlab/codemirror 4.0.0-rc.0 → 4.0.0-rc.1

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.
@@ -4,6 +4,35 @@ import { CodeEditor } from '@jupyterlab/codeeditor';
4
4
  import { IBaseSearchProvider, IFilters, IReplaceOptions } from '@jupyterlab/documentsearch';
5
5
  import { ISignal, Signal } from '@lumino/signaling';
6
6
  import { ISharedText, SourceChange } from '@jupyter/ydoc';
7
+ /**
8
+ * Defines from which position the search should be executed.
9
+ * - `'selection'` - search from selection head/anchor (depending on search direction)
10
+ * - `'previous-match'` - search from previous match
11
+ * - `'auto'` - search from selection if editor is focused or previous match otherwise
12
+ * - `'selection-start'` - search from selection head/anchor whichever is smaller
13
+ * - `'start'` - from start of the editor
14
+ */
15
+ type SearchStartAnchor = 'auto' | 'selection' | 'selection-start' | 'previous-match' | 'start';
16
+ interface IHighlightMatchOptions {
17
+ /**
18
+ * Whether the highlighted match should be scrolled into view.
19
+ * Defaults to `true`.
20
+ */
21
+ scroll?: boolean;
22
+ /**
23
+ * Whether the user cursor should be moved to select the match.
24
+ * `protectSelection` flag takes precedence over this option.
25
+ * Defaults to `true`.
26
+ */
27
+ select?: boolean;
28
+ }
29
+ export interface IHighlightAdjacentMatchOptions extends IHighlightMatchOptions {
30
+ /**
31
+ * What should be used as an anchor when searching for adjacent match.
32
+ * Defaults to `'auto'`.
33
+ */
34
+ from?: SearchStartAnchor;
35
+ }
7
36
  /**
8
37
  * Search provider for editors.
9
38
  */
@@ -64,9 +93,20 @@ export declare abstract class EditorSearchProvider<T extends CodeEditor.IModel =
64
93
  */
65
94
  setIsActive(v: boolean): Promise<void>;
66
95
  /**
67
- * Set whether search should be limitted to specified selection.
96
+ * Set whether search should be limitted to specified text selection.
68
97
  */
69
98
  setSearchSelection(selection: CodeEditor.IRange | null): Promise<void>;
99
+ /**
100
+ * Set whether user selection should be protected from modifications.
101
+ *
102
+ * If disabled, the selection will be updated on search and on editor focus
103
+ * to cover the current match. We need to protect selection from modifications
104
+ * for both: search in text and search in cells; since `setSearchSelection`
105
+ * is only telling us about search in text, we need to have an additional
106
+ * way to signal that either search in text or in cells is active, or for
107
+ * any other reason selection range should be protected.
108
+ */
109
+ setProtectSelection(v: boolean): void;
70
110
  /**
71
111
  * Initialize the search using the provided options. Should update the UI
72
112
  * to highlight all matches and "select" the first match.
@@ -84,13 +124,13 @@ export declare abstract class EditorSearchProvider<T extends CodeEditor.IModel =
84
124
  *
85
125
  * @returns The next match if there is one.
86
126
  */
87
- highlightNext(loop?: boolean, fromCursor?: boolean): Promise<ISearchMatch | undefined>;
127
+ highlightNext(loop?: boolean, options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
88
128
  /**
89
129
  * Highlight the previous match.
90
130
  *
91
131
  * @returns The previous match if there is one.
92
132
  */
93
- highlightPrevious(loop?: boolean, fromCursor?: boolean): Promise<ISearchMatch | undefined>;
133
+ highlightPrevious(loop?: boolean, options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
94
134
  /**
95
135
  * Replace the currently selected match with the provided text.
96
136
  *
@@ -157,9 +197,9 @@ export declare abstract class EditorSearchProvider<T extends CodeEditor.IModel =
157
197
  *
158
198
  * **NOTES:**
159
199
  * - to retain the selection visibility `drawSelection` extension is needed.
160
- * - highlighting starts from the cursor (if editor is focused, cursor moved,
161
- * or `fromCursor` argument is set to `true`), or from last "current" match
162
- * otherwise.
200
+ * - highlighting starts from the cursor (if editor is focused and `from` is set
201
+ * to `'auto'`, cursor moved, or `from` argument is set to `'selection'` or
202
+ * `'selection-start'`), or from last "current" match otherwise.
163
203
  * - `currentIndex` is the (readonly) source of truth for the current match.
164
204
  */
165
205
  export declare class CodeMirrorSearchHighlighter {
@@ -179,6 +219,12 @@ export declare class CodeMirrorSearchHighlighter {
179
219
  get matches(): ISearchMatch[];
180
220
  set matches(v: ISearchMatch[]);
181
221
  private _current;
222
+ /**
223
+ * Whether the cursor/selection should not be modified.
224
+ */
225
+ get protectSelection(): boolean;
226
+ set protectSelection(v: boolean);
227
+ private _protectSelection;
182
228
  /**
183
229
  * Clear all highlighted matches
184
230
  */
@@ -192,13 +238,13 @@ export declare class CodeMirrorSearchHighlighter {
192
238
  *
193
239
  * @returns The next match if available
194
240
  */
195
- highlightNext(fromCursor?: boolean, doNotModifySelection?: boolean): Promise<ISearchMatch | undefined>;
241
+ highlightNext(options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
196
242
  /**
197
243
  * Highlight the previous match
198
244
  *
199
245
  * @returns The previous match if available
200
246
  */
201
- highlightPrevious(fromCursor?: boolean): Promise<ISearchMatch | undefined>;
247
+ highlightPrevious(options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
202
248
  /**
203
249
  * Set the editor
204
250
  *
@@ -216,4 +262,6 @@ export declare class CodeMirrorSearchHighlighter {
216
262
  private _highlightMark;
217
263
  private _currentMark;
218
264
  private _highlightField;
265
+ private _domEventHandlers;
219
266
  }
267
+ export {};
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
- import { StateEffect, StateField } from '@codemirror/state';
3
+ import { EditorSelection, StateEffect, StateField } from '@codemirror/state';
4
4
  import { Decoration, EditorView } from '@codemirror/view';
5
5
  import { GenericSearchProvider, TextSearchEngine } from '@jupyterlab/documentsearch';
6
6
  import { Signal } from '@lumino/signaling';
@@ -114,7 +114,7 @@ export class EditorSearchProvider {
114
114
  }
115
115
  }
116
116
  /**
117
- * Set whether search should be limitted to specified selection.
117
+ * Set whether search should be limitted to specified text selection.
118
118
  */
119
119
  async setSearchSelection(selection) {
120
120
  if (this._inSelection === selection) {
@@ -124,6 +124,19 @@ export class EditorSearchProvider {
124
124
  await this.updateCodeMirror(this.model.sharedModel.getSource());
125
125
  this._stateChanged.emit();
126
126
  }
127
+ /**
128
+ * Set whether user selection should be protected from modifications.
129
+ *
130
+ * If disabled, the selection will be updated on search and on editor focus
131
+ * to cover the current match. We need to protect selection from modifications
132
+ * for both: search in text and search in cells; since `setSearchSelection`
133
+ * is only telling us about search in text, we need to have an additional
134
+ * way to signal that either search in text or in cells is active, or for
135
+ * any other reason selection range should be protected.
136
+ */
137
+ setProtectSelection(v) {
138
+ this.cmHandler.protectSelection = v;
139
+ }
127
140
  /**
128
141
  * Initialize the search using the provided options. Should update the UI
129
142
  * to highlight all matches and "select" the first match.
@@ -152,13 +165,12 @@ export class EditorSearchProvider {
152
165
  *
153
166
  * @returns The next match if there is one.
154
167
  */
155
- async highlightNext(loop = true, fromCursor = false) {
168
+ async highlightNext(loop = true, options) {
156
169
  if (this.matchesCount === 0 || !this.isActive) {
157
170
  this.currentIndex = null;
158
171
  }
159
172
  else {
160
- // This starts from the cursor position if `fromCursor` is true
161
- let match = await this.cmHandler.highlightNext(fromCursor);
173
+ let match = await this.cmHandler.highlightNext(options);
162
174
  if (match) {
163
175
  this.currentIndex = this.cmHandler.currentIndex;
164
176
  }
@@ -177,13 +189,12 @@ export class EditorSearchProvider {
177
189
  *
178
190
  * @returns The previous match if there is one.
179
191
  */
180
- async highlightPrevious(loop = true, fromCursor = false) {
192
+ async highlightPrevious(loop = true, options) {
181
193
  if (this.matchesCount === 0 || !this.isActive) {
182
194
  this.currentIndex = null;
183
195
  }
184
196
  else {
185
- // This starts from the cursor position if `fromCursor` is true
186
- let match = await this.cmHandler.highlightPrevious(fromCursor);
197
+ let match = await this.cmHandler.highlightPrevious(options);
187
198
  if (match) {
188
199
  this.currentIndex = this.cmHandler.currentIndex;
189
200
  }
@@ -315,7 +326,11 @@ export class EditorSearchProvider {
315
326
  // A special case to always have a current match when in line selection mode.
316
327
  if (this.cmHandler.currentIndex === null &&
317
328
  this.cmHandler.matches.length > 0) {
318
- await this.cmHandler.highlightNext(true, false);
329
+ await this.cmHandler.highlightNext({
330
+ from: 'selection',
331
+ select: false,
332
+ scroll: false
333
+ });
319
334
  }
320
335
  this.currentIndex = this.cmHandler.currentIndex;
321
336
  }
@@ -336,9 +351,9 @@ export class EditorSearchProvider {
336
351
  *
337
352
  * **NOTES:**
338
353
  * - to retain the selection visibility `drawSelection` extension is needed.
339
- * - highlighting starts from the cursor (if editor is focused, cursor moved,
340
- * or `fromCursor` argument is set to `true`), or from last "current" match
341
- * otherwise.
354
+ * - highlighting starts from the cursor (if editor is focused and `from` is set
355
+ * to `'auto'`, cursor moved, or `from` argument is set to `'selection'` or
356
+ * `'selection-start'`), or from last "current" match otherwise.
342
357
  * - `currentIndex` is the (readonly) source of truth for the current match.
343
358
  */
344
359
  export class CodeMirrorSearchHighlighter {
@@ -378,6 +393,8 @@ export class CodeMirrorSearchHighlighter {
378
393
  if (ef.is(this._highlightEffect)) {
379
394
  const e = ef;
380
395
  if (e.value.matches.length) {
396
+ // Note: nesting will vary; sometimes `.cm-searching` will be
397
+ // inside `.jp-current-match`, sometime the other way round.
381
398
  highlights = highlights.update({
382
399
  add: e.value.matches.map(m => this._highlightMark.range(m.position, m.position + m.text.length)),
383
400
  // filter out old marks
@@ -401,6 +418,12 @@ export class CodeMirrorSearchHighlighter {
401
418
  },
402
419
  provide: f => EditorView.decorations.from(f)
403
420
  });
421
+ this._domEventHandlers = EditorView.domEventHandlers({
422
+ focus: () => {
423
+ // Set cursor on active match when editor gets focused.
424
+ this._selectCurrentMatch();
425
+ }
426
+ });
404
427
  }
405
428
  /**
406
429
  * The current index of the selected match.
@@ -420,7 +443,16 @@ export class CodeMirrorSearchHighlighter {
420
443
  this._currentIndex > this._matches.length) {
421
444
  this._currentIndex = this._matches.length > 0 ? 0 : null;
422
445
  }
423
- this._highlightCurrentMatch(true);
446
+ this._highlightCurrentMatch({ select: false });
447
+ }
448
+ /**
449
+ * Whether the cursor/selection should not be modified.
450
+ */
451
+ get protectSelection() {
452
+ return this._protectSelection;
453
+ }
454
+ set protectSelection(v) {
455
+ this._protectSelection = v;
424
456
  }
425
457
  /**
426
458
  * Clear all highlighted matches
@@ -447,9 +479,10 @@ export class CodeMirrorSearchHighlighter {
447
479
  *
448
480
  * @returns The next match if available
449
481
  */
450
- highlightNext(fromCursor = false, doNotModifySelection = false) {
451
- this._currentIndex = this._findNext(false, fromCursor);
452
- this._highlightCurrentMatch(doNotModifySelection);
482
+ highlightNext(options) {
483
+ var _a;
484
+ this._currentIndex = this._findNext(false, (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : 'auto');
485
+ this._highlightCurrentMatch(options);
453
486
  return Promise.resolve(this._currentIndex !== null
454
487
  ? this._matches[this._currentIndex]
455
488
  : undefined);
@@ -459,9 +492,10 @@ export class CodeMirrorSearchHighlighter {
459
492
  *
460
493
  * @returns The previous match if available
461
494
  */
462
- highlightPrevious(fromCursor = false) {
463
- this._currentIndex = this._findNext(true, fromCursor);
464
- this._highlightCurrentMatch();
495
+ highlightPrevious(options) {
496
+ var _a;
497
+ this._currentIndex = this._findNext(true, (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : 'auto');
498
+ this._highlightCurrentMatch(options);
465
499
  return Promise.resolve(this._currentIndex !== null
466
500
  ? this._matches[this._currentIndex]
467
501
  : undefined);
@@ -480,10 +514,23 @@ export class CodeMirrorSearchHighlighter {
480
514
  if (this._currentIndex !== null) {
481
515
  this._highlightCurrentMatch();
482
516
  }
517
+ this._cm.editor.dispatch({
518
+ effects: StateEffect.appendConfig.of(this._domEventHandlers)
519
+ });
483
520
  this._refresh();
484
521
  }
485
522
  }
486
- _selectCurrentMatch() {
523
+ _selectCurrentMatch(scroll = true) {
524
+ // This method has two responsibilities:
525
+ // 1) Scroll the current match into the view - useful for long lines,
526
+ // and file editors with more lines that fit on the screen
527
+ // 2) When user has focus on the editor (not search box) and presses
528
+ // ctrl + g/ctrl + shift + g to jump to next match they want their
529
+ // cursor to jump too.
530
+ // We execute (1) and (2) together as CodeMirror has a special code path
531
+ // to handle both in a single dispatch.
532
+ // The (2) case is inapplicable to search in selection mode, as it would
533
+ // invalidate the query selection, so in that case we only execute (1).
487
534
  const match = this._current;
488
535
  if (!match) {
489
536
  return;
@@ -491,21 +538,32 @@ export class CodeMirrorSearchHighlighter {
491
538
  if (!this._cm) {
492
539
  return;
493
540
  }
494
- const selection = this._cm.editor.state.selection.main;
495
- if (selection.from === match.position &&
496
- selection.to === match.position + match.text.length) {
497
- return;
498
- }
499
541
  const cursor = {
500
542
  anchor: match.position,
501
543
  head: match.position + match.text.length
502
544
  };
503
- this._cm.editor.dispatch({
504
- selection: cursor,
505
- scrollIntoView: true
506
- });
545
+ const selection = this._cm.editor.state.selection.main;
546
+ if ((selection.from === match.position &&
547
+ selection.to === match.position + match.text.length) ||
548
+ this._protectSelection) {
549
+ // Correct selection is already set or search is restricted to selection:
550
+ // scroll without changing the selection.
551
+ if (scroll) {
552
+ this._cm.editor.dispatch({
553
+ effects: EditorView.scrollIntoView(EditorSelection.range(cursor.anchor, cursor.head))
554
+ });
555
+ return;
556
+ }
557
+ }
558
+ else {
559
+ this._cm.editor.dispatch({
560
+ selection: cursor,
561
+ scrollIntoView: scroll
562
+ });
563
+ }
507
564
  }
508
- _highlightCurrentMatch(doNotModifySelection = false) {
565
+ _highlightCurrentMatch(options) {
566
+ var _a, _b, _c;
509
567
  if (!this._cm) {
510
568
  // no-op
511
569
  return;
@@ -514,13 +572,15 @@ export class CodeMirrorSearchHighlighter {
514
572
  if (this._currentIndex !== null) {
515
573
  const match = this.matches[this._currentIndex];
516
574
  this._current = match;
517
- // Do not change selection/scroll if user is selecting
518
- if (!doNotModifySelection) {
575
+ // We do not change selection nor scroll if:
576
+ // - user is selecting text,
577
+ // - document was modified
578
+ if ((_a = options === null || options === void 0 ? void 0 : options.select) !== null && _a !== void 0 ? _a : true) {
519
579
  if (this._cm.hasFocus()) {
520
580
  // If editor is focused we actually set the cursor on the match.
521
- this._selectCurrentMatch();
581
+ this._selectCurrentMatch((_b = options === null || options === void 0 ? void 0 : options.scroll) !== null && _b !== void 0 ? _b : true);
522
582
  }
523
- else {
583
+ else if ((_c = options === null || options === void 0 ? void 0 : options.scroll) !== null && _c !== void 0 ? _c : true) {
524
584
  // otherwise we just scroll to preserve the selection.
525
585
  this._cm.editor.dispatch({
526
586
  effects: EditorView.scrollIntoView(match.position)
@@ -546,26 +606,26 @@ export class CodeMirrorSearchHighlighter {
546
606
  ];
547
607
  if (!this._cm.state.field(this._highlightField, false)) {
548
608
  effects.push(StateEffect.appendConfig.of([this._highlightField]));
549
- // set cursor on active match when editor gets focused
550
- const focusExtension = EditorView.domEventHandlers({
551
- focus: () => {
552
- this._selectCurrentMatch();
553
- }
554
- });
555
- effects.push(StateEffect.appendConfig.of([focusExtension]));
556
609
  }
557
610
  this._cm.editor.dispatch({ effects });
558
611
  }
559
- _findNext(reverse, fromCursor = false) {
612
+ _findNext(reverse, from = 'auto') {
560
613
  if (this._matches.length === 0) {
561
614
  // No-op
562
615
  return null;
563
616
  }
564
617
  let lastPosition = 0;
565
- if (this._cm.hasFocus() || fromCursor) {
618
+ if ((from === 'auto' && this._cm.hasFocus()) || from === 'selection') {
566
619
  const cursor = this._cm.state.selection.main;
567
620
  lastPosition = reverse ? cursor.anchor : cursor.head;
568
621
  }
622
+ else if (from === 'selection-start') {
623
+ const cursor = this._cm.state.selection.main;
624
+ lastPosition = Math.min(cursor.anchor, cursor.head);
625
+ }
626
+ else if (from === 'start') {
627
+ lastPosition = 0;
628
+ }
569
629
  else if (this._current) {
570
630
  lastPosition = reverse
571
631
  ? this._current.position
@@ -1 +1 @@
1
- {"version":3,"file":"searchprovider.js","sourceRoot":"","sources":["../src/searchprovider.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAiC3D,OAAO,EAAE,WAAW,EAAmB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EACL,qBAAqB,EAIrB,gBAAgB,EACjB,MAAM,4BAA4B,CAA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D,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;YAEjD,IAAI,eAAe,GAAG,QAAQ,EAAE;gBAC9B,UAAU,GAAG,MAAM,GAAG,CAAC,CAAC;gBACxB,IACE,UAAU,GAAG,OAAO,CAAC,MAAM;oBAC3B,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,GAAG,QAAQ,EACvC;oBACA,OAAO,UAAU,CAAC;iBACnB;aACF;iBAAM,IAAI,eAAe,GAAG,QAAQ,EAAE;gBACrC,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC;gBACzB,IAAI,WAAW,GAAG,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,QAAQ,GAAG,QAAQ,EAAE;oBAC/D,OAAO,MAAM,CAAC;iBACf;aACF;iBAAM;gBACL,OAAO,MAAM,CAAC;aACf;SACF;QAED,+BAA+B;QAC/B,MAAM,KAAK,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;IAlCe,cAAQ,WAkCvB,CAAA;AACH,CAAC,EAhDS,KAAK,KAAL,KAAK,QAgDd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/codemirror",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.1",
4
4
  "description": "JupyterLab - CodeMirror Editor Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -59,11 +59,11 @@
59
59
  "@codemirror/state": "^6.2.0",
60
60
  "@codemirror/view": "^6.9.6",
61
61
  "@jupyter/ydoc": "^1.0.2",
62
- "@jupyterlab/codeeditor": "^4.0.0-rc.0",
63
- "@jupyterlab/coreutils": "^6.0.0-rc.0",
64
- "@jupyterlab/documentsearch": "^4.0.0-rc.0",
65
- "@jupyterlab/nbformat": "^4.0.0-rc.0",
66
- "@jupyterlab/translation": "^4.0.0-rc.0",
62
+ "@jupyterlab/codeeditor": "^4.0.0-rc.1",
63
+ "@jupyterlab/coreutils": "^6.0.0-rc.1",
64
+ "@jupyterlab/documentsearch": "^4.0.0-rc.1",
65
+ "@jupyterlab/nbformat": "^4.0.0-rc.1",
66
+ "@jupyterlab/translation": "^4.0.0-rc.1",
67
67
  "@lezer/common": "^1.0.2",
68
68
  "@lezer/generator": "^1.2.2",
69
69
  "@lezer/highlight": "^1.1.4",
@@ -73,7 +73,7 @@
73
73
  "yjs": "^13.5.40"
74
74
  },
75
75
  "devDependencies": {
76
- "@jupyterlab/testing": "^4.0.0-rc.0",
76
+ "@jupyterlab/testing": "^4.0.0-rc.1",
77
77
  "@lezer/generator": "^1.2.2",
78
78
  "@lezer/lr": "^1.3.3",
79
79
  "@types/jest": "^29.2.0",
@@ -32,7 +32,13 @@
32
32
 
33
33
  import { ISearchMatch } from '@jupyterlab/documentsearch';
34
34
  import { CodeMirrorEditor } from './editor';
35
- import { StateEffect, StateEffectType, StateField } from '@codemirror/state';
35
+ import {
36
+ EditorSelection,
37
+ Extension,
38
+ StateEffect,
39
+ StateEffectType,
40
+ StateField
41
+ } from '@codemirror/state';
36
42
  import { Decoration, DecorationSet, EditorView } from '@codemirror/view';
37
43
  import { CodeEditor } from '@jupyterlab/codeeditor';
38
44
  import {
@@ -45,6 +51,43 @@ import {
45
51
  import { ISignal, Signal } from '@lumino/signaling';
46
52
  import { ISharedText, SourceChange } from '@jupyter/ydoc';
47
53
 
54
+ /**
55
+ * Defines from which position the search should be executed.
56
+ * - `'selection'` - search from selection head/anchor (depending on search direction)
57
+ * - `'previous-match'` - search from previous match
58
+ * - `'auto'` - search from selection if editor is focused or previous match otherwise
59
+ * - `'selection-start'` - search from selection head/anchor whichever is smaller
60
+ * - `'start'` - from start of the editor
61
+ */
62
+ type SearchStartAnchor =
63
+ | 'auto'
64
+ | 'selection'
65
+ | 'selection-start'
66
+ | 'previous-match'
67
+ | 'start';
68
+
69
+ interface IHighlightMatchOptions {
70
+ /**
71
+ * Whether the highlighted match should be scrolled into view.
72
+ * Defaults to `true`.
73
+ */
74
+ scroll?: boolean;
75
+ /**
76
+ * Whether the user cursor should be moved to select the match.
77
+ * `protectSelection` flag takes precedence over this option.
78
+ * Defaults to `true`.
79
+ */
80
+ select?: boolean;
81
+ }
82
+
83
+ export interface IHighlightAdjacentMatchOptions extends IHighlightMatchOptions {
84
+ /**
85
+ * What should be used as an anchor when searching for adjacent match.
86
+ * Defaults to `'auto'`.
87
+ */
88
+ from?: SearchStartAnchor;
89
+ }
90
+
48
91
  /**
49
92
  * Search provider for editors.
50
93
  */
@@ -167,7 +210,7 @@ export abstract class EditorSearchProvider<
167
210
  }
168
211
 
169
212
  /**
170
- * Set whether search should be limitted to specified selection.
213
+ * Set whether search should be limitted to specified text selection.
171
214
  */
172
215
  async setSearchSelection(selection: CodeEditor.IRange | null): Promise<void> {
173
216
  if (this._inSelection === selection) {
@@ -178,6 +221,20 @@ export abstract class EditorSearchProvider<
178
221
  this._stateChanged.emit();
179
222
  }
180
223
 
224
+ /**
225
+ * Set whether user selection should be protected from modifications.
226
+ *
227
+ * If disabled, the selection will be updated on search and on editor focus
228
+ * to cover the current match. We need to protect selection from modifications
229
+ * for both: search in text and search in cells; since `setSearchSelection`
230
+ * is only telling us about search in text, we need to have an additional
231
+ * way to signal that either search in text or in cells is active, or for
232
+ * any other reason selection range should be protected.
233
+ */
234
+ setProtectSelection(v: boolean) {
235
+ this.cmHandler.protectSelection = v;
236
+ }
237
+
181
238
  /**
182
239
  * Initialize the search using the provided options. Should update the UI
183
240
  * to highlight all matches and "select" the first match.
@@ -211,13 +268,12 @@ export abstract class EditorSearchProvider<
211
268
  */
212
269
  async highlightNext(
213
270
  loop = true,
214
- fromCursor = false
271
+ options?: IHighlightAdjacentMatchOptions
215
272
  ): Promise<ISearchMatch | undefined> {
216
273
  if (this.matchesCount === 0 || !this.isActive) {
217
274
  this.currentIndex = null;
218
275
  } else {
219
- // This starts from the cursor position if `fromCursor` is true
220
- let match = await this.cmHandler.highlightNext(fromCursor);
276
+ let match = await this.cmHandler.highlightNext(options);
221
277
  if (match) {
222
278
  this.currentIndex = this.cmHandler.currentIndex;
223
279
  } else {
@@ -239,13 +295,12 @@ export abstract class EditorSearchProvider<
239
295
  */
240
296
  async highlightPrevious(
241
297
  loop = true,
242
- fromCursor = false
298
+ options?: IHighlightAdjacentMatchOptions
243
299
  ): Promise<ISearchMatch | undefined> {
244
300
  if (this.matchesCount === 0 || !this.isActive) {
245
301
  this.currentIndex = null;
246
302
  } else {
247
- // This starts from the cursor position if `fromCursor` is true
248
- let match = await this.cmHandler.highlightPrevious(fromCursor);
303
+ let match = await this.cmHandler.highlightPrevious(options);
249
304
  if (match) {
250
305
  this.currentIndex = this.cmHandler.currentIndex;
251
306
  } else {
@@ -405,7 +460,11 @@ export abstract class EditorSearchProvider<
405
460
  this.cmHandler.currentIndex === null &&
406
461
  this.cmHandler.matches.length > 0
407
462
  ) {
408
- await this.cmHandler.highlightNext(true, false);
463
+ await this.cmHandler.highlightNext({
464
+ from: 'selection',
465
+ select: false,
466
+ scroll: false
467
+ });
409
468
  }
410
469
  this.currentIndex = this.cmHandler.currentIndex;
411
470
  } else {
@@ -452,9 +511,9 @@ interface IEffectValue {
452
511
  *
453
512
  * **NOTES:**
454
513
  * - to retain the selection visibility `drawSelection` extension is needed.
455
- * - highlighting starts from the cursor (if editor is focused, cursor moved,
456
- * or `fromCursor` argument is set to `true`), or from last "current" match
457
- * otherwise.
514
+ * - highlighting starts from the cursor (if editor is focused and `from` is set
515
+ * to `'auto'`, cursor moved, or `from` argument is set to `'selection'` or
516
+ * `'selection-start'`), or from last "current" match otherwise.
458
517
  * - `currentIndex` is the (readonly) source of truth for the current match.
459
518
  */
460
519
  export class CodeMirrorSearchHighlighter {
@@ -495,6 +554,8 @@ export class CodeMirrorSearchHighlighter {
495
554
  if (ef.is(this._highlightEffect)) {
496
555
  const e = ef as StateEffect<IEffectValue>;
497
556
  if (e.value.matches.length) {
557
+ // Note: nesting will vary; sometimes `.cm-searching` will be
558
+ // inside `.jp-current-match`, sometime the other way round.
498
559
  highlights = highlights.update({
499
560
  add: e.value.matches.map(m =>
500
561
  this._highlightMark.range(
@@ -525,6 +586,13 @@ export class CodeMirrorSearchHighlighter {
525
586
  },
526
587
  provide: f => EditorView.decorations.from(f)
527
588
  });
589
+
590
+ this._domEventHandlers = EditorView.domEventHandlers({
591
+ focus: () => {
592
+ // Set cursor on active match when editor gets focused.
593
+ this._selectCurrentMatch();
594
+ }
595
+ });
528
596
  }
529
597
 
530
598
  /**
@@ -548,11 +616,22 @@ export class CodeMirrorSearchHighlighter {
548
616
  ) {
549
617
  this._currentIndex = this._matches.length > 0 ? 0 : null;
550
618
  }
551
- this._highlightCurrentMatch(true);
619
+ this._highlightCurrentMatch({ select: false });
552
620
  }
553
621
 
554
622
  private _current: ISearchMatch | null = null;
555
623
 
624
+ /**
625
+ * Whether the cursor/selection should not be modified.
626
+ */
627
+ get protectSelection(): boolean {
628
+ return this._protectSelection;
629
+ }
630
+ set protectSelection(v: boolean) {
631
+ this._protectSelection = v;
632
+ }
633
+ private _protectSelection: boolean;
634
+
556
635
  /**
557
636
  * Clear all highlighted matches
558
637
  */
@@ -583,11 +662,10 @@ export class CodeMirrorSearchHighlighter {
583
662
  * @returns The next match if available
584
663
  */
585
664
  highlightNext(
586
- fromCursor = false,
587
- doNotModifySelection = false
665
+ options?: IHighlightAdjacentMatchOptions
588
666
  ): Promise<ISearchMatch | undefined> {
589
- this._currentIndex = this._findNext(false, fromCursor);
590
- this._highlightCurrentMatch(doNotModifySelection);
667
+ this._currentIndex = this._findNext(false, options?.from ?? 'auto');
668
+ this._highlightCurrentMatch(options);
591
669
  return Promise.resolve(
592
670
  this._currentIndex !== null
593
671
  ? this._matches[this._currentIndex]
@@ -600,9 +678,11 @@ export class CodeMirrorSearchHighlighter {
600
678
  *
601
679
  * @returns The previous match if available
602
680
  */
603
- highlightPrevious(fromCursor = false): Promise<ISearchMatch | undefined> {
604
- this._currentIndex = this._findNext(true, fromCursor);
605
- this._highlightCurrentMatch();
681
+ highlightPrevious(
682
+ options?: IHighlightAdjacentMatchOptions
683
+ ): Promise<ISearchMatch | undefined> {
684
+ this._currentIndex = this._findNext(true, options?.from ?? 'auto');
685
+ this._highlightCurrentMatch(options);
606
686
  return Promise.resolve(
607
687
  this._currentIndex !== null
608
688
  ? this._matches[this._currentIndex]
@@ -623,11 +703,24 @@ export class CodeMirrorSearchHighlighter {
623
703
  if (this._currentIndex !== null) {
624
704
  this._highlightCurrentMatch();
625
705
  }
706
+ this._cm.editor.dispatch({
707
+ effects: StateEffect.appendConfig.of(this._domEventHandlers)
708
+ });
626
709
  this._refresh();
627
710
  }
628
711
  }
629
712
 
630
- private _selectCurrentMatch(): void {
713
+ private _selectCurrentMatch(scroll = true): void {
714
+ // This method has two responsibilities:
715
+ // 1) Scroll the current match into the view - useful for long lines,
716
+ // and file editors with more lines that fit on the screen
717
+ // 2) When user has focus on the editor (not search box) and presses
718
+ // ctrl + g/ctrl + shift + g to jump to next match they want their
719
+ // cursor to jump too.
720
+ // We execute (1) and (2) together as CodeMirror has a special code path
721
+ // to handle both in a single dispatch.
722
+ // The (2) case is inapplicable to search in selection mode, as it would
723
+ // invalidate the query selection, so in that case we only execute (1).
631
724
  const match = this._current;
632
725
  if (!match) {
633
726
  return;
@@ -635,24 +728,35 @@ export class CodeMirrorSearchHighlighter {
635
728
  if (!this._cm) {
636
729
  return;
637
730
  }
638
- const selection = this._cm.editor.state.selection.main;
639
- if (
640
- selection.from === match.position &&
641
- selection.to === match.position + match.text.length
642
- ) {
643
- return;
644
- }
645
731
  const cursor = {
646
732
  anchor: match.position,
647
733
  head: match.position + match.text.length
648
734
  };
649
- this._cm.editor.dispatch({
650
- selection: cursor,
651
- scrollIntoView: true
652
- });
735
+ const selection = this._cm.editor.state.selection.main;
736
+ if (
737
+ (selection.from === match.position &&
738
+ selection.to === match.position + match.text.length) ||
739
+ this._protectSelection
740
+ ) {
741
+ // Correct selection is already set or search is restricted to selection:
742
+ // scroll without changing the selection.
743
+ if (scroll) {
744
+ this._cm.editor.dispatch({
745
+ effects: EditorView.scrollIntoView(
746
+ EditorSelection.range(cursor.anchor, cursor.head)
747
+ )
748
+ });
749
+ return;
750
+ }
751
+ } else {
752
+ this._cm.editor.dispatch({
753
+ selection: cursor,
754
+ scrollIntoView: scroll
755
+ });
756
+ }
653
757
  }
654
758
 
655
- private _highlightCurrentMatch(doNotModifySelection = false): void {
759
+ private _highlightCurrentMatch(options?: IHighlightMatchOptions): void {
656
760
  if (!this._cm) {
657
761
  // no-op
658
762
  return;
@@ -662,12 +766,14 @@ export class CodeMirrorSearchHighlighter {
662
766
  if (this._currentIndex !== null) {
663
767
  const match = this.matches[this._currentIndex];
664
768
  this._current = match;
665
- // Do not change selection/scroll if user is selecting
666
- if (!doNotModifySelection) {
769
+ // We do not change selection nor scroll if:
770
+ // - user is selecting text,
771
+ // - document was modified
772
+ if (options?.select ?? true) {
667
773
  if (this._cm.hasFocus()) {
668
774
  // If editor is focused we actually set the cursor on the match.
669
- this._selectCurrentMatch();
670
- } else {
775
+ this._selectCurrentMatch(options?.scroll ?? true);
776
+ } else if (options?.scroll ?? true) {
671
777
  // otherwise we just scroll to preserve the selection.
672
778
  this._cm.editor.dispatch({
673
779
  effects: EditorView.scrollIntoView(match.position)
@@ -694,27 +800,28 @@ export class CodeMirrorSearchHighlighter {
694
800
 
695
801
  if (!this._cm!.state.field(this._highlightField, false)) {
696
802
  effects.push(StateEffect.appendConfig.of([this._highlightField]));
697
- // set cursor on active match when editor gets focused
698
- const focusExtension = EditorView.domEventHandlers({
699
- focus: () => {
700
- this._selectCurrentMatch();
701
- }
702
- });
703
- effects.push(StateEffect.appendConfig.of([focusExtension]));
704
803
  }
705
804
  this._cm!.editor.dispatch({ effects });
706
805
  }
707
806
 
708
- private _findNext(reverse: boolean, fromCursor = false): number | null {
807
+ private _findNext(
808
+ reverse: boolean,
809
+ from: SearchStartAnchor = 'auto'
810
+ ): number | null {
709
811
  if (this._matches.length === 0) {
710
812
  // No-op
711
813
  return null;
712
814
  }
713
815
 
714
816
  let lastPosition = 0;
715
- if (this._cm!.hasFocus() || fromCursor) {
817
+ if ((from === 'auto' && this._cm!.hasFocus()) || from === 'selection') {
716
818
  const cursor = this._cm!.state.selection.main;
717
819
  lastPosition = reverse ? cursor.anchor : cursor.head;
820
+ } else if (from === 'selection-start') {
821
+ const cursor = this._cm!.state.selection.main;
822
+ lastPosition = Math.min(cursor.anchor, cursor.head);
823
+ } else if (from === 'start') {
824
+ lastPosition = 0;
718
825
  } else if (this._current) {
719
826
  lastPosition = reverse
720
827
  ? this._current.position
@@ -757,6 +864,7 @@ export class CodeMirrorSearchHighlighter {
757
864
  private _highlightMark: Decoration;
758
865
  private _currentMark: Decoration;
759
866
  private _highlightField: StateField<DecorationSet>;
867
+ private _domEventHandlers: Extension;
760
868
  }
761
869
 
762
870
  /**
package/style/base.css CHANGED
@@ -59,24 +59,28 @@
59
59
 
60
60
  .cm-searching,
61
61
  .cm-searching span {
62
+ /* `.cm-searching span`: we need to override syntax highlighting */
62
63
  background-color: var(--jp-search-unselected-match-background-color);
63
64
  color: var(--jp-search-unselected-match-color);
64
65
  }
65
66
 
66
- .cm-content .cm-searching::selection,
67
- .cm-content .cm-searching span::selection {
67
+ .cm-searching::selection,
68
+ .cm-searching span::selection {
68
69
  background-color: var(--jp-search-unselected-match-background-color);
69
70
  color: var(--jp-search-unselected-match-color);
70
71
  }
71
72
 
72
- .jp-current-match .cm-searching,
73
- .jp-current-match .cm-searching span {
73
+ .jp-current-match > .cm-searching,
74
+ .jp-current-match > .cm-searching span,
75
+ .cm-searching > .jp-current-match,
76
+ .cm-searching > .jp-current-match span {
74
77
  background-color: var(--jp-search-selected-match-background-color);
75
78
  color: var(--jp-search-selected-match-color);
76
79
  }
77
80
 
78
- .cm-content .jp-current-match .cm-searching::selection,
79
- .cm-content .jp-current-match .cm-searching span::selection {
81
+ .jp-current-match > .cm-searching::selection,
82
+ .cm-searching > .jp-current-match::selection,
83
+ .jp-current-match > .cm-searching span::selection {
80
84
  background-color: var(--jp-search-selected-match-background-color);
81
85
  color: var(--jp-search-selected-match-color);
82
86
  }