Skip to content

Commit

Permalink
Fix duplicate backgrounds when using horizontal and vertical editor s…
Browse files Browse the repository at this point in the history
…plit (#69)
  • Loading branch information
Katsute authored Nov 26, 2022
1 parent 6bd381d commit e9249d0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,21 @@ const setEditorBackground = () => {
shuffle(iEditorBackgrounds);
for(let i = 1; i <= len; i++){
let csx = [...Array(len)].map(() => []);
for(let i = 0; i < len; i++){
csx[i].push(\`#workbench\\\\.parts\\\\.editor :not(.split-view-container) .split-view-container > .split-view-view:nth-child(\${len}n+\${i+1}) > .editor-group-container::after\`);
for(let j = 0; j < len; j++){
csx[(i+j)%len].push(\`#workbench\\\\.parts\\\\.editor .split-view-container > .split-view-view:nth-child(\${len}n+\${i+1}) .split-view-container > .split-view-view:nth-child(\${len}n+\${j+1}) > .editor-group-container::after\`);
};
};
for(let i = 0; i < len; i++){
bk_editor_image.appendChild(document.createTextNode(\`
.split-view-view:nth-child(\${len}n+\${i}) > .editor-group-container::after {
\${csx[i].join(',')} {
background-image: url("\${editorBackgrounds[iEditorBackgrounds[i-1]]}");
background-image: url("\${editorBackgrounds[iEditorBackgrounds[i]]}");
}
\`));
Expand Down

0 comments on commit e9249d0

Please sign in to comment.