@codemirror/search
Advanced tools
Comparing version 0.19.10 to 0.20.0
@@ -0,1 +1,7 @@ | ||
## 0.20.0 (2022-04-20) | ||
### Bug fixes | ||
Make the `wholeWords` option to `highlightSelectionMatches` default to false, as intended. | ||
## 0.19.10 (2022-04-04) | ||
@@ -2,0 +8,0 @@ |
import * as _codemirror_state from '@codemirror/state'; | ||
import { Extension, StateCommand, EditorState } from '@codemirror/state'; | ||
import { Command, KeyBinding, EditorView } from '@codemirror/view'; | ||
import { Panel } from '@codemirror/panel'; | ||
import { Text } from '@codemirror/text'; | ||
import { Text, Extension, StateCommand, EditorState } from '@codemirror/state'; | ||
import { Command, KeyBinding, EditorView, Panel } from '@codemirror/view'; | ||
@@ -165,4 +163,4 @@ /** | ||
/** | ||
Select next occurrence of the current selection. | ||
Expand selection to the word when selection range is empty. | ||
Select next occurrence of the current selection. Expand selection | ||
to the surrounding word when the selection is empty. | ||
*/ | ||
@@ -184,3 +182,3 @@ declare const selectNextOccurrence: StateCommand; | ||
Can be used to override the way the search panel is implemented. | ||
Should create a [Panel](https://codemirror.net/6/docs/ref/#panel.Panel) that contains a form | ||
Should create a [Panel](https://codemirror.net/6/docs/ref/#view.Panel) that contains a form | ||
which lets the user: | ||
@@ -201,4 +199,4 @@ | ||
configure the search extension. | ||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) when automatically | ||
enable this if it isn't already on.) | ||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) will automatically | ||
enable this if it isn't already on). | ||
*/ | ||
@@ -258,2 +256,6 @@ declare function search(config?: SearchConfig): Extension; | ||
eq(other: SearchQuery): boolean; | ||
/** | ||
Get a search cursor for this query, searching through the given | ||
range in the given document. | ||
*/ | ||
getCursor(doc: Text, from?: number, to?: number): Iterator<{ | ||
@@ -260,0 +262,0 @@ from: number; |
@@ -1,7 +0,4 @@ | ||
import { EditorView, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view'; | ||
import { StateEffect, StateField, EditorSelection, Facet, combineConfig, CharCategory, Prec } from '@codemirror/state'; | ||
import { showPanel, getPanel } from '@codemirror/panel'; | ||
import { RangeSetBuilder } from '@codemirror/rangeset'; | ||
import { showPanel, EditorView, getPanel, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view'; | ||
import { codePointAt, fromCodePoint, codePointSize, StateEffect, StateField, EditorSelection, Facet, combineConfig, CharCategory, RangeSetBuilder, Prec } from '@codemirror/state'; | ||
import elt from 'crelt'; | ||
import { codePointAt, fromCodePoint, codePointSize } from '@codemirror/text'; | ||
@@ -342,3 +339,3 @@ const basicNormalize = typeof String.prototype.normalize == "function" | ||
} | ||
return { dom, pos: -10 }; | ||
return { dom }; | ||
} | ||
@@ -392,3 +389,3 @@ const dialogEffect = /*@__PURE__*/StateEffect.define(); | ||
maxMatches: 100, | ||
wholeWords: true | ||
wholeWords: false | ||
}; | ||
@@ -527,4 +524,4 @@ const highlightConfig = /*@__PURE__*/Facet.define({ | ||
/** | ||
Select next occurrence of the current selection. | ||
Expand selection to the word when selection range is empty. | ||
Select next occurrence of the current selection. Expand selection | ||
to the surrounding word when the selection is empty. | ||
*/ | ||
@@ -553,3 +550,3 @@ const selectNextOccurrence = ({ state, dispatch }) => { | ||
top: configs.reduce((val, conf) => val !== null && val !== void 0 ? val : conf.top, undefined) || false, | ||
caseSensitive: configs.reduce((val, conf) => val !== null && val !== void 0 ? val : (conf.caseSensitive || conf.matchCase), undefined) || false, | ||
caseSensitive: configs.reduce((val, conf) => val !== null && val !== void 0 ? val : conf.caseSensitive, undefined) || false, | ||
createPanel: ((_a = configs.find(c => c.createPanel)) === null || _a === void 0 ? void 0 : _a.createPanel) || (view => new SearchPanel(view)) | ||
@@ -562,4 +559,4 @@ }; | ||
configure the search extension. | ||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) when automatically | ||
enable this if it isn't already on.) | ||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) will automatically | ||
enable this if it isn't already on). | ||
*/ | ||
@@ -570,6 +567,2 @@ function search(config) { | ||
/** | ||
@internal | ||
*/ | ||
const searchConfig = search; // FIXME drop on next release | ||
/** | ||
A search query. Part of the editor's search state. | ||
@@ -602,2 +595,6 @@ */ | ||
} | ||
/** | ||
Get a search cursor for this query, searching through the given | ||
range in the given document. | ||
*/ | ||
getCursor(doc, from = 0, to = doc.length) { | ||
@@ -1129,2 +1126,2 @@ return this.regexp ? regexpCursor(this, doc, from, to) : stringCursor(this, doc, from, to); | ||
export { RegExpCursor, SearchCursor, SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, gotoLine, highlightSelectionMatches, openSearchPanel, replaceAll, replaceNext, search, searchConfig, searchKeymap, selectMatches, selectNextOccurrence, selectSelectionMatches, setSearchQuery }; | ||
export { RegExpCursor, SearchCursor, SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, gotoLine, highlightSelectionMatches, openSearchPanel, replaceAll, replaceNext, search, searchKeymap, selectMatches, selectNextOccurrence, selectSelectionMatches, setSearchQuery }; |
{ | ||
"name": "@codemirror/search", | ||
"version": "0.19.10", | ||
"version": "0.20.0", | ||
"description": "Search functionality for the CodeMirror code editor", | ||
@@ -29,7 +29,4 @@ "scripts": { | ||
"dependencies": { | ||
"@codemirror/panel": "^0.19.0", | ||
"@codemirror/rangeset": "^0.19.0", | ||
"@codemirror/state": "^0.19.3", | ||
"@codemirror/text": "^0.19.0", | ||
"@codemirror/view": "^0.19.34", | ||
"@codemirror/state": "^0.20.0", | ||
"@codemirror/view": "^0.20.0", | ||
"crelt": "^1.0.5" | ||
@@ -36,0 +33,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
105252
2550
+ Added@codemirror/state@0.20.1(transitive)
+ Added@codemirror/view@0.20.7(transitive)
- Removed@codemirror/panel@^0.19.0
- Removed@codemirror/rangeset@^0.19.0
- Removed@codemirror/text@^0.19.0
- Removed@codemirror/panel@0.19.1(transitive)
- Removed@codemirror/rangeset@0.19.9(transitive)
- Removed@codemirror/state@0.19.9(transitive)
- Removed@codemirror/text@0.19.6(transitive)
- Removed@codemirror/view@0.19.48(transitive)
Updated@codemirror/state@^0.20.0
Updated@codemirror/view@^0.20.0