Skip to content
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 of functions/if statements etc. does not work properly in certain situations #4007

Closed
lulle2007200 opened this issue Mar 11, 2021 · 5 comments
Assignees
Milestone

Comments

@lulle2007200
Copy link

lulle2007200 commented Mar 11, 2021

Description

Folding of functions/if statements etc. does not work properly in certain situations

Steps to reproduce

//folding works properly
void foo(){
	int a;
	int b;
}

//folding works properly
void foo1(int a, int b){
	int c;
	int d;
}

//folding not available
void foo2(int a,
          int b){
	int c;
	int d;
}

//folding does not work properly
void foo3(int a,
          int b,
          int c){
	int d;
	int e;
}

//same issue with if statements

//folding works properly
void foo4(){
	if(true){
		int a;
		int b;
	}
}

bool foo6(int a, int b, int c){
	return(true);
}

//folding works properly
void foo7(){
	if(1 == 1 ||
	   2 == 2 ||
	   3 == 3){
		int a;
		int b;
	}
}

//folding does not work properly when condition has function
void foo5(){
	if(foo6(1,
	        2,
	        3) && 5==5){
		int a;
		int b;
	}
}

Expected behavior

Folding should fold the entire respective code block

Actual behavior

Code from above unfolded:
image
Code from above folded
image

Environment

  • Build: 4098
  • Operating system and version: Windows 10 Build 19042
@keith-hall
Copy link
Collaborator

Possible duplicate of #101

@BenjaminSchaaf BenjaminSchaaf self-assigned this Mar 15, 2021
@BenjaminSchaaf BenjaminSchaaf added this to the Build 4100 milestone Apr 6, 2021
@BenjaminSchaaf
Copy link
Member

Fixed in build 4100.

@FichteFoll
Copy link
Collaborator

I can confirm that foo3 (and foo5) are fixed, but there is still no folding indicator for foo2. Here's another example from YAML.sublime-syntax:

    - match: |
        (?x)
        (?=
          {{ns_plain_first_plain_out}}
          (
              [^\s:]
            | : \S
            | \s+ (?![#\s])
          )*
          \s*
          :
          (\s|$)
        )
      push:

2021-04-15_01-46-01

I would expect a folding arrow in line 641 here. If I duplicate the line below, 642, then a folding arrow appears and pressing it folds until the current 645.

@BenjaminSchaaf BenjaminSchaaf removed this from the Build 4100 milestone Apr 16, 2021
@BenjaminSchaaf
Copy link
Member

Fixed in build 4103.

@FichteFoll
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants