Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

'else' statement disappeared when the 'if' statement is fold in #227

Open
1 task done
jerrykal opened this issue Apr 11, 2017 · 2 comments
Open
1 task done

'else' statement disappeared when the 'if' statement is fold in #227

jerrykal opened this issue Apr 11, 2017 · 2 comments

Comments

@jerrykal
Copy link
Contributor

Prerequisites

Description

else statement disappeared when the if statement is fold in

Steps to Reproduce

  1. Open a C/C++ file
  2. Add these code into the file:
int main() {
  if (/* expression */) {
    // some code
  } else {
    // some code
  }
}
  1. Fold the if statement and you'll see the problem

Expected behavior:

screen shot 2017-04-11 at 16 08 56

Actual behavior:

screen shot 2017-04-11 at 16 09 55

Versions

Atom: 1.16.0-beta0
OS: macOS sierra

@jerrykal jerrykal changed the title [Bug] 'else' statement disappeared when the 'if' statement is fold in 'else' statement disappeared when the 'if' statement is fold in Apr 11, 2017
@jerrykal
Copy link
Contributor Author

@50Wliu I fix this 🐛 by change foldEndPattern from (?<!\\*)\\*\\*/|^\\s*\\} to (?<!\\*)\\*\\} , can you take a look ?

@winstliu
Copy link
Contributor

Can you create a PR for that?

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

No branches or pull requests

2 participants