[cm6] Add "within selection" option to the search form (#12798)

* Use forked @codemirror/search
* Use getPanel to get the search panel
* Remove layer-based highlightSelectionMatches
* Add "within selection" option to the search form
* Add test for "replace all within selection"
* Fix tests

GitOrigin-RevId: 95ce76fd017f96278b04c16a1fd34f785f7504a3
This commit is contained in:
Alf Eaton
2023-05-01 08:05:02 +00:00
committed by Copybot
parent 7f7443356c
commit e0d9069131
10 changed files with 178 additions and 169 deletions
@@ -195,20 +195,6 @@ const staticTheme = EditorView.theme({
marginLeft: '-1px', // half the border width
borderLeftColor: 'inherit',
},
// set the default "selection match" style
'.cm-selectionMatch, .cm-searchMatch': {
backgroundColor: 'transparent',
outlineOffset: '-1px',
},
// make sure selectionMatch inside searchMatch doesn't have a background colour
'.cm-searchMatch .cm-selectionMatch': {
backgroundColor: 'transparent !important',
},
// Match the height of search matches to selection matches
'.cm-searchMatch': {
paddingTop: 'var(--half-leading)',
paddingBottom: 'var(--half-leading)',
},
// remove border from hover tooltips (e.g. cursor highlights)
'.cm-tooltip-hover': {
border: 'none',