How do I change the size and placement of the search panel?
Ditto for the go-to-line panel.
How do I change the size and placement of the search panel?
Ditto for the go-to-line panel.
This can be used to put the search panel at the top of the editor. The go-line-panel has no such option. I’m not sure what you mean by changing the size of the panels – they are sized to fit their content.
I tried a few things, e.g., as in the code below — but I’m not understanding/guessing the correct syntax:
let editor = new EditorView({
search: {config: {top: true}},
state: EditorState.create({
extensions: [basicSetup
, myTheme
, EditorView.lineWrapping
// Below: send updated text from CM to Elm
, EditorView.updateListener.of((v)=> {
if(v.docChanged) {
sendText(editor)
}
})
],
You want search({top: true})
in your extensions array.
Oops! I get the error
(index):53605 Uncaught ReferenceError: search is not defined
with
let editor = new EditorView({
state: EditorState.create({
extensions: [basicSetup
, myTheme
, panelTheme
, EditorView.lineWrapping
, search({top: true})
// Below: send updated text from CM to Elm
, EditorView.updateListener.of((v)=> {
if(v.docChanged) {
sendText(editor)
}
})
],
..
You clearly need to import search
from @codemirror/search
.
I’ve tried that, with import {search} from "@codemirror/search"
, but I get the error
[!] Error: 'search' is not exported by node_modules/@codemirror/search/dist/index.js, imported by editor.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
editor.js (11:8)
9: import {EditorView} from "@codemirror/view"
10:
11: import {search} from "@codemirror/search"
^
12:
13: let myTheme = EditorView.theme({
Error: 'search' is not exported by node_modules/@codemirror/search/dist/index.js, imported by editor.js
at error (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:160:30)
at Module.error (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:12438:16)
at Module.traceVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:12808:29)
at ModuleScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:11601:39)
at ChildScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
at ClassBodyScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
at ChildScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
at FunctionScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
at ChildScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
at TrackingScope.findVariable (/Users/jxxcarlson/dev/bluesky/L0-lab-demo/editor-prepare/node_modules/rollup/dist/shared/rollup.js:6964:38)
Here is what I find in node_modules/@codemirror/search
:
(base) ➜ search git:(master) ✗ tree .
.
├── CHANGELOG.md
├── LICENSE
├── README.md
├── dist
│ ├── index.cjs
│ ├── index.d.ts
│ └── index.js
└── package.json
1 directory, 7 files
(base) ➜ search git:(master) ✗
Try updating your packages or just deleting node_modules and reinstalling.
search
is indeed exported:
search()
was added in 0.19.8, upgrading should help.
Thanks! done