You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
::before decorators are not rendered if the range is at the end of the line
::after decorators are not rendered if the range is at the beginning of the line
Only ::before shows for empty lines (which might be the same issue as above)
Note that this is all for empty ranges.
I need both ::after and ::before (because I need the content CSS property twice). Currently I can't do that because only one shows up at the start or end of the line.
consteditor=vscode.window.activeTextEditor;constdoc=editor.document;// Set up ::before at the start and end of line 0constbeforeDeco=vscode.window.createTextEditorDecorationType({before: {contentText: 'b',color: 'yellow'}});constline0Range=doc.lineAt(0).range;constline0Start=newvscode.Range(line0Range.start,line0Range.start);constline0End=newvscode.Range(line0Range.end,line0Range.end);editor.setDecorations(beforeDeco,[line0Start,line0End]);// Set up ::after at the start and end of line 1constafterDeco=vscode.window.createTextEditorDecorationType({after: {contentText: 'a',color: 'red'}});constline1Range=doc.lineAt(1).range;constline1Start=newvscode.Range(line1Range.start,line1Range.start);constline1End=newvscode.Range(line1Range.end,line1Range.end);editor.setDecorations(afterDeco,[line1Start,line1End]);// Set up ::before and ::after on line 3 (empty line)constbeforeAfterDeco=vscode.window.createTextEditorDecorationType({before: {contentText: 'b',color: 'yellow'},after: {contentText: 'a',color: 'red'}});constline3Range=doc.lineAt(3).range;constline3Start=newvscode.Range(line3Range.start,line3Range.start);editor.setDecorations(beforeAfterDeco,[line3Start]);
The text was updated successfully, but these errors were encountered:
From @guillaumejenkins
@alexandrudima is this by design?
Note that this is all for empty ranges.
I need both ::after and ::before (because I need the
content
CSS property twice). Currently I can't do that because only one shows up at the start or end of the line.The text was updated successfully, but these errors were encountered: