We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No response
It doesn't really work.
I want to render the specified content green
function getPosition(v: string) { if (!editor) return; const model = editor.getModel()!; const content = editor.getValue(); const startIndex = content.indexOf(v); if (startIndex === -1) { return; } const endIndex = startIndex + v.length; // Get start and end positions const startPosition = model.getPositionAt(startIndex); const endPosition = model.getPositionAt(endIndex); const startLineNumber = startPosition.lineNumber; const startColumn = startPosition.column; const endLineNumber = endPosition.lineNumber; const endColumn = endPosition.column; return { startLineNumber, startColumn, endLineNumber, endColumn }; } editor.setValue(value); const position = getPosition(props.data.version); if (position) { const { startLineNumber, startColumn, endLineNumber, endColumn } = position; editor.createDecorationsCollection([ { range: new monaco.Range(startLineNumber, startColumn, endLineNumber, endColumn), options: { inlineClassName: 'version-decorations', }, }, ]); .version-decorations { font-weight: bold; font-style: oblique; color: green !important; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
Reproduction Steps
No response
Actual (Problematic) Behavior
It doesn't really work.
Expected Behavior
I want to render the specified content green
Additional Context
The text was updated successfully, but these errors were encountered: