-
Notifications
You must be signed in to change notification settings - Fork 25
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
Code Folding #89
Comments
This is a simple fix that I will address in a PR.
I didn't check With, but Case seemed correct to me. Can you give an example where it isn't working as you expect? |
Apologies, I added a Case and With statement, but didn't populate the middle with code. |
Unsure how to correct this. Maybe @loganch will have some ideas.
I think these are viewed as multiple single line comments, so no folding is available. P.S. I've noticed a few other issues with folding --
|
Look like this is corrected by adding |
I take that back. It does seem to fold if the contents are indented, but the folding appears off. It's like For example -- Test()
Func Test()
Local $sStr1
#cs
Local $sStr2
Local $sStr3
#ce
Local $sStr4
EndFunc |
I'm not sure how related syntax highlighting is to code-folding, so this may need to be a separate issue. |
@seadoggie01 That code was meant to be copy / pasted into VSCode so that you could observe the issue I was describing with #ce and folding. |
Sorry, Danp2, I didn't word that quite right. Your code displays the same in VSCode for me too. I was bringing up that if you paste this instead...
then you'll see that Local $sStr4 appears to be commented, even though it isn't :) |
This corrects the issue with #comment-start/#comment-end/#cs/#ce failing to end syntax highlighting when mixed together, and adds proper code folding functionality when comments are added. I was able to get the syntax highlighting for the blocks to work together by combining their Regex in the .tmLanguage file. To fix the folding I simply added them to folding.markers in the language configuration file. Addresses issue #89.
I've found a problem with folding of Func Test()
Local $vResult = Default
If $iErr Then $vResult = ""
$vResult = True
EndFunc The lines following the If statement are improperly hidden when you fold the If statement. @loganch Suggestions on how to fix? |
I tried adding
To me, the first sentence makes it sound like the custom folding range could be overwritten by the "built in" folding markers, but the second sentence reads like the smaller range will work. |
Not sure. I think that Note that I recall seeing an If $iErr Then _
$vResult = "" so that could complicate identifying |
I think I have found another issue with code Folding. It seems to me every time the Word "Next" is used it leads also to a wrong folding even when used in a comment. I do Installer GUI Automation with AutoIt and "Next" is used very often to identify Controls.
|
Folding is inconsistent from SciTE
If
,While
,Switch
, andFor
statements don't fold their respective closing keywords.Func
toEndFunc
are folded properlyCase
andWith
sections aren't foldedThe underscore causes extra newlines to be folded:
The text was updated successfully, but these errors were encountered: