@uiw/codemirror-extensions-line-numbers-relative
v4.23.6
Published
Relative line numbers Extensions for CodeMirror6.
Downloads
857
Readme
Relative Line Numbers Extensions
Relative line numbers Extensions for CodeMirror6.
Install
npm install @uiw/codemirror-extensions-line-numbers-relative --save
Usage
import CodeMirror from '@uiw/react-codemirror';
import { lineNumbersRelative } from '@uiw/codemirror-extensions-line-numbers-relative';
function App() {
return <CodeMirror value="console.log('hello world!');" height="200px" extensions={[lineNumbersRelative]} />;
}
export default App;
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { lineNumbersRelative } from '@uiw/codemirror-extensions-line-numbers-relative';
const state = EditorState.create({
doc: 'my source code',
extensions: [lineNumbersRelative],
});
const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
Contributors
As always, thanks to our amazing contributors!
Made with github-action-contributors.
License
Licensed under the MIT License.