-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
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
[folding] Allow to specify if decorator should hide in collapsed region #4812
Comments
@alefragnani If you could add also a code snippet that would be great. That way I can use this as test once we add language agnostic folding. |
Hi @aeschli , I will post a code snippet latter, when I go back to my home 😄 , but in the meantime you could see the same behavior using breakpoints. If you set a breakpoint inside a function and fold the entire function, the breakpoint is presented in the folding line. If that is the expected behavior, than it's ok... I just thought it should suppress the icon. Thanks |
Hi @aeschli , The code is fairly simple. I just create a
var bookmarkDecorationType = vscode.window.createTextEditorDecorationType({
gutterIconPath: pathIcon,
overviewRulerLane: vscode.OverviewRulerLane.Full,
overviewRulerColor: 'rgba(21, 126, 251, 0.7)'
});
var books: vscode.Range[] = [];
for (var index = 0; index < activeBookmark.bookmarks.length; index++) {
var element = activeBookmark.bookmarks[index];
var decoration = new vscode.Range(element, 0, element, 0);
books.push(decoration);
}
vscode.window.activeTextEditor.setDecorations(bookmarkDecorationType, books); As you can see, the decoration is defined to individual lines, to display the icon in the Thanks for your help |
@alefragnani Ah, now I understand. Ignore my first comment (I removed it). |
@aeschli No problem. In fact it was my fault, because I should have added this GIF right in the first post 😄 About your suggestion, I totally agree 👍 . Thanks again |
For the May release I added a new setting so that the fold controls stay always visible: |
Hi @aeschli , fold controls avaiable on version 1.12.1 ?? |
It will be in 1.13 |
Sorry, I closed the wrong issue. |
"editor.showFoldingControls": "always" |
Thanks @martin77s, I created #35885 |
Since 1.18, decorations inside folded regions are hidden for performance reasons. They are no longer shown in the gutter. |
When you define
decorators
for an editor (activeEditor.setDecorations
), you must define aRange
, which can be a specific line where you want to add that decorator (an image withgutterIconPath
for instance).But if you Fold the lines where this decorator is defined, the icon is not hidden with the lines, but instead, it is shown in the line where the folding starts.
I didn't find anything in
line
ordecorators
that could be used to detect if the line is folded, so I think that the folding engine should be taking care of that, right?Thanks in advance
The text was updated successfully, but these errors were encountered: