-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Add code folding to the Editor #3833
Conversation
Great work @rlaverde! Could you post a screenshot for this new feature as part of the description? Thanks! |
@ccordoba12 at the current state it's not possible, It just show an empty panel, I think that after implemented the missing part in SyntaxHighlighter, it will work :) |
adf4f13
to
31f7472
Compare
This is really cool!! Thanks a lot @rlaverde!! How folding is computed? Using regexs? |
Using Indentation, although It could be extended to use other methods |
Ok, that's fine for Python, but we definitely need to add other methods for languages like C/C++ and Fortran ;-) In any case this is a hell of a improvement!! Good job :-) |
436dbc6
to
078100a
Compare
f9d36b4
to
f9f6b80
Compare
@goanpeca @ccordoba12 This is ready, only missing a rebase with master after #3778 merge |
Woot! so baby jesus is getting code folding after all 🤣 |
Great work @rlaverde! Really nice Christmas present for Spyder!! I have one question: is this only applied to Python files (for now)? |
One important suggestion before reviewing: please use FontAwesome icons for the folding marks, and not just the PNG's you provided. That's very important to preserve not only consistency but also our ability to render correctly in high DPI screens. |
@rlaverde yes, could we use those icons better :-) ? |
Png's are fine for the Spyder 2 theme, but we also need to use FontAwesome icons :-) |
@rlaverde could you rebase now that panels are merged? |
75d3d0e
to
7f22c1d
Compare
This is applied to all files, folding are detected using indentation (with the len of
Ready, I deleted old pngs and use caret font awesome icons. (I squashed the commit)
I just rebase it with master 😄 |
@ccordoba12 are we planning on having pngs with Spyder 4.0? I would say that on 4.0 we should only support ttf fonts via qtawesome? |
I agree, but until we do that we're still supporting the Spyder 2 theme :-) |
But this is on Master... so why should we support it on master? |
7f22c1d
to
43d4cd4
Compare
Use QStyleOptionViewItem for PyQt4 and PyQt5.
Emit this signals in corresponding methods.
- Make syntaxHighlighter process blocks for folding. - Change syntaxHiglighter calls to use TextBlockHelper. - Add simple docstrings highlight_block methods, and fix some style issues.
Fix some style issues in docstrings
@ccordoba12 unless you have more comments this is ready to be merged |
Fixes #706
Progress:
decoration.py
folding.py
utils.py
codefolding.py
managers/decoration.py
TODO:
Somethings that I'm not sure if should be do it:- Remove decoration.py and implement It's functionality in CodeEditorI think is ok to leave it- Remove utils.py and use CodeEditor functionality (and implement missing functionalities)I think is ok to leave it tooThings that I'll address in other PRs
use different icons for folding arrows)