-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add the ability to collapse nodes in the outline for XML. #59
base: master
Are you sure you want to change the base?
Conversation
} | ||
whitespace = whitespace.replace(/\t/g, tmpSpaces); | ||
return (whitespace.length / indentSize) | 0; | ||
return whitespace.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation seems off here.
Thanks for your PR. Could you give some more explanation as to why you changed the |
Thanks for looking at this one so quickly. Sorry for all the indentation issues, I was editing and testing out different indentations at the same time which wasn't the best idea :) I'll sort that stuff and the inline function out later this evening. I was looking at a sample XML that had indentation of three spaces and then I had Brackets set to a tab size of 4 (from memory) and it resulted in no indentation for the first indent level. No indentation means no icon and so you can't collapse. Here is the file: I will give this one some more thought to see if I can come up with something better. In general I guess it needs to handle edge cases where the editor indent size is greater than the document's indent. |
I think I dealt with the indentation and the inline. It's late here now so I'll look at the _getIndentationLevel change tomorrow. |
Thanks for your effort. Generally, I don't think this extension has to handle indentation problems. And btw, to detect and automatically set the indentation I have another extension: |
That sounds fair - I'll revert the indentation stuff when I get home. And I'll be sure to check out the other extension :) |
This change allows the user to click on an icon to the left of the node to collapse the children of that node - much like in the file tree. It allows you to close an inner node then open and close an outer one without affecting the state of the inner set.
The one thing I wasn't sure about was my change in _getIndentationLevel - it's a bit severe but I was having problems when browsing a document with different indentation than my editor settings so I decided to simplify things and rely on the actual indentation in the document.