Code Folding is broken, can't see hundreds of lines of code in Editor

조회 수: 38 (최근 30일)
Val
Val 2024년 10월 24일
이동: the cyclist 2024년 10월 24일
Hi everyone, I'm having a serious issue within the MATLAB Editor. I really like writing my code using sections (as defined by %% syntax) and then enabling code folding for sections for readability.
Recently I opened a .mat file I used very regularly a few months ago and found that this code folding is very broken. The plus/minus icons next to the line numbers are not always aligned with the sections or really anything that can be code-folded, at least as far as I can tell. Also, and most critically, I can't unfold enough to see all of my code. The best I can do is display lines 1-232 and lines 783-951, but everything between 232-783 is completely inaccessible. There is a clickable ellipsis at the end of line 232, but clicking it does absolutely nothing (I saw the same clickable ellipsis in other lines, and clicking it would unfold some more code). Also, line 232 is not the end of that section of code.
Thankfully, if I hit "Run" then the whole code runs with no problem. But this is still a huge issue because I can't access 500+ lines of my code to edit them. I have attached a screenshot of my editor (with the code itself greyed out) showing exactly what I mean.
I've had similar code folding issues before but they were fairly easy to resolve by messing with the code folding settings in "Preferences" or just restarting MATLAB. Doing so now doesn't help at all. Any help with this would be immensely appreciated.

답변 (1개)

Saurabh
Saurabh 2024년 10월 24일
이동: the cyclist 2024년 10월 24일
Hi @Val,
I experienced the same issue but could fix it by clicking on the button "Expand All" in the "View" tab of Matlab App Designer.
Or it may be because MATLAB wasn't able to parse the entire .m file. Check out the following link if this is the case: 
If this does not solve the issue, consider contacting MathWorks technical support.
I hope this helps.
  댓글 수: 1
Val
Val 2024년 10월 24일
이동: the cyclist 2024년 10월 24일
Clicking the Expand All button resolved my issue. Thank you very much!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by