![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/836545/image.png)
When debugging in R2021b, the current line is highlighted in light green making it impossible to read the line when the text color is light and background is dark.
조회 수: 15 (최근 30일)
이전 댓글 표시
This happens only when the function being viewed is above in the call-stack from the one at which execution has stopped.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821380/image.png)
Any idea how this color might be changed?
EDIT:
See below an example showing how to reproduce this problem, this time with the default colors:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821585/image.png)
댓글 수: 7
채택된 답변
Rik
2022년 3월 24일
The line highlight has been changed to a much darker shade of green in R2022a. This leaves code readible if you have set your font color to something light.
So there isn't a solution in R2021b, but R2022a will get you what you need.
추가 답변 (1개)
dpb
2021년 12월 2일
Under preferences, "Editor/Debugger" the checkbox "Highlight Current Line" has the option to select the highlight color.
댓글 수: 8
RAF
2022년 1월 27일
The highlighting follows user specification for the most recent call on the stack, but all predecessor calls appear with a mysterious MATLAB-default highlighting. In the attached image, the caller line is blindingly highlighted in the default shading while the callee line is subtly highlighted per user preference. The unreadable default highlighting is, by the way, visible all the rest of the way up the stack. Curiously, the highlighting for me is not pale green, but a gray value (RGB DCDCDC hex). This difference with previous posts may suggest that there is some offsetting relative to another unknown, but--perhaps--user specified preference or window-manager setting, though I have no grays in my MATLAB scheme.
By the way, the editor's current-line highlighting only reflects the cursor position, not the execution position, which just coincidentally happens to be instantly set to the same line when stopped at a breakpoint or stepping during debugging. In other words, during a breakpoint pause, one can tap on any line in the file and move the current-line highlighting pointed out by @dpb, leaving only the dark green filled arrow and overline, but with unhighlighted text at the execution point. That being noted, it is likely that there is no explicit user preference for call-stack highlighting. As you can see, though, there should be.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/876210/image.png)
Andrea De Polis
2022년 2월 16일
I do have the same, very annoying issue. I can see the highlighted lines only by highlighing them with the cursor.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/896850/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/896850/image.png)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!