Skip to content

Commit

Permalink
test highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yan committed Jul 27, 2024
1 parent f95372d commit 5e793ef
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions code/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -158956,16 +158956,12 @@ function App() {
const startAndEndLine = s.split(":");
const startLine = parseInt(startAndEndLine[0]);
const endLine = parseInt(startAndEndLine[1]);
const range2 = {
startLineNumber: startLine + 1,
startColumn: 1,
endLineNumber: endLine + 1,
endColumn: 9
};
const range2 = new Range2(startLine + 1, 1, endLine + 1, 9);
highlightRanges.push(range2);
}
}
}
console.log("highlightRanges", highlightRanges);
currentFolder = folder && getDetailsByFolder(folder) || getFirstFolderDetails(content().default_sample ? content().default_sample : null);
if (currentFolder !== null) {
setFiles([...currentFolder.files]);
Expand Down Expand Up @@ -159054,7 +159050,17 @@ function App() {
}
});
if (highlightRanges.length > 0) {
editor$12.createDecorationsCollection(highlightRanges.map((range2) => {
console.log("decorations", highlightRanges.map((range2) => {
return {
range: range2,
options: {
isWholeLine: true,
inlineClassName: "highlight-line"
}
};
}));
const editorModel = editor$12.getModel();
editorModel.deltaDecorations([], highlightRanges.map((range2) => {
return {
range: range2,
options: {
Expand Down

0 comments on commit 5e793ef

Please sign in to comment.