Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Missing Line numbers in m flile

469 views
Skip to first unread message

Alan Jennings

unread,
Dec 30, 2010, 9:50:20 AM12/30/10
to
Hi Everyone,

I have this issue that's annoying, and I'm wondering what exactly is causing it.
Every now and then, the line numbers in the m-file editor just disappear. Under Preferences, Editor/Debugger, Display: Show Line Numbers is still selected. If it makes a difference, I have the file names going down the left side of the editor window (makes it easier to see more of the file name and you don't need to scroll).

My guess is there's some sort of limit for files longer than 1000 lines (line how the line number bar grows going from 9 to 10 lines). But once I loose the line numbers, there gone from all my files, not just the long ones. I can still see the line number from the status bar, but often I forget about it.

Any help is appreciated.
Thanks,
Alan

Andy

unread,
Dec 30, 2010, 10:24:04 AM12/30/10
to
"Alan Jennings" wrote in message <ifi67c$3l1$1...@fred.mathworks.com>...

I'm currently working on an m-file that is about 6000 lines long and the line numbers work perfectly for me. I don't think the length of the file is the issue. Perhaps you should contact technical support.

ImageAnalyst

unread,
Dec 30, 2010, 10:31:20 AM12/30/10
to
I've seen this too, on occasion, about every 2 or 3 weeks. I blame it
on some MATLAB/Java bug. Everything works except there are no line
numbers in the editor window. It's annoying but restarting MATLAB
fixes it. I work on m-files that usually have in the neighborhood of
2000-3000 lines.

Joe Hays

unread,
Jan 27, 2011, 5:07:03 PM1/27/11
to
ImageAnalyst <imagea...@mailinator.com> wrote in message <2e2bf5ab-acee-4432...@30g2000yql.googlegroups.com>...

For what its worth... I've also experienced this bug. Hopefully the Mathworks will list with a growing list of folks being affected by it. My code is only about 1500-1000 lines.

Ken

unread,
Jan 28, 2011, 2:55:04 PM1/28/11
to
This happens to me every few days. My workaround is to quit Matlab and then restart it and I get the line numbers back. I am using R2009a.

Parthiv Shah

unread,
Mar 14, 2011, 5:06:05 PM3/14/11
to
"Ken" wrote in message <ihv6uo$b68$1...@fred.mathworks.com>...

> This happens to me every few days. My workaround is to quit Matlab and then restart it and I get the line numbers back. I am using R2009a.

I have also experienced this issue and have used the same workaround as the others, namely, to close and reopen Matlab (R2009b)

Rick

unread,
Nov 17, 2011, 6:55:30 PM11/17/11
to
i'm using 2011 b and it still has the mystery of disappearing line numbers. i usually have a whole bunch of different functions and scripts so i keep my code fairly short. it seems quite random.

"Parthiv Shah" wrote in message <illvvt$1s0$1...@fred.mathworks.com>...

Quint

unread,
Jan 12, 2012, 8:14:08 PM1/12/12
to
Experiencing disappearing line numbers too. Seems to occur when screen-resolution changes.

I use software to remote control my Matlab computer which changes the resolution so text can easily be read from the smaller screen. Sure would be nice if I could use it and still have line numbers.

Rubin

unread,
Jan 29, 2012, 5:19:09 PM1/29/12
to
I have the same problem from time to time. I am using v7.11 under windows 7. It appears more often when I use remote desktop.

"Alan Jennings" wrote in message <ifi67c$3l1$1...@fred.mathworks.com>...

Alex

unread,
Feb 15, 2012, 5:21:12 PM2/15/12
to
I have the exact same problem. simply reopening the file fixes it for me. like other users mention, i also use remote desktop (windows 7, 2011b), so maybe it's related to that?

Steven_Lord

unread,
Feb 16, 2012, 9:39:42 AM2/16/12
to


"Alex " <a...@b.com> wrote in message
news:jhhb4o$7h6$1...@newscl01ah.mathworks.com...
> I have the exact same problem. simply reopening the file fixes it for me.
> like other users mention, i also use remote desktop (windows 7, 2011b), so
> maybe it's related to that?

Anyone that's running into this issue, please contact Technical Support so
that they can work with you to try to determine the cause of the problem.

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Sepideh

unread,
Nov 12, 2012, 10:13:16 PM11/12/12
to
There is this very small hollow space in the left bottom corner of the editor window that you need to drag to the right so that the line numbers show. They are just hidden and you can't see them! :) I think this happens when some of you use remote desktop just because of the monitor size difference.

"Steven_Lord" <sl...@mathworks.com> wrote in message <jhj4fd$r1n$1...@newscl01ah.mathworks.com>...

Brian

unread,
Apr 10, 2013, 12:11:09 PM4/10/13
to
"Sepideh" wrote in message <k7sdsc$1e8$1...@newscl01ah.mathworks.com>...
> There is this very small hollow space in the left bottom corner of the editor window that you need to drag to the right so that the line numbers show. They are just hidden and you can't see them! :) I think this happens when some of you use remote desktop just because of the monitor size difference.

I just tried this and it brought the numbers back in R2011a, but it also produced a java error (did the same thing on a coworkers computer in a newer version):

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at com.mathworks.widgets.SyntaxTextPaneMultiView$DragButtonMouseListener.mouseDragged(SyntaxTextPaneMultiView.java:1446)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Vincent

unread,
Sep 17, 2013, 12:06:07 PM9/17/13
to
I had the same problem. I easily fixed it by changing the settings under:

File -> Preferences -> Editor/Debugger -> Display

Then toggle the 'show line numbers' box. Mine was 'off', so it was an easy fix.

While it solved my problem, it seems others may have more graphics related issue. If the switch is already on, try giving Matlab a little nudge by toggling it 'off', applying that, and then switching it back 'on'.

Hope this helps!

Vince

Ryan Curtis

unread,
Oct 9, 2013, 1:21:06 PM10/9/13
to
I have had the same problem, and last night connected using Remote Desktop which triggered the problem again.

In addition to losing the line number display, I also lose the M-LINT/Code Analyzer color boxes on the right side, which is more frustrating for me than the line numbers.

I tried dragging the little handle in the lower left, which only shows up when there is a horizontal scroll bar. That worked, but threw the same Java error that Brian reported.

I also found that using the right-click menu to split the screen Left/Right and then toggle the screen split back off clears the problem wihtout any errors in the command window. It's tedious, as I usually have a dozen or more files open in the editor and I have to do this on each tab. But for times when I don't want to restart MATLAB, this seems like a useful workaround.

I'd love to see this fixed in the new version. I'm still running 2012b.

Steven Lord

unread,
Oct 9, 2013, 1:37:41 PM10/9/13
to

"Ryan Curtis" <rcur...@blueorigin.delXs.com> wrote in message
news:l343a2$njk$1...@newscl01ah.mathworks.com...
Please contact Technical Support directly and work with them to determine
the root cause of this behavior. Determining that root cause is likely going
to take some time and investigation work, and by working with Support
directly they can report this cause to the developers and hopefully fix it
in a future release (and perhaps even provide a more straightforward
workaround.)

Yair Altman

unread,
Oct 9, 2013, 3:43:05 PM10/9/13
to
"Ryan Curtis" <rcur...@blueorigin.delXs.com> wrote in message <l343a2$njk$1...@newscl01ah.mathworks.com>...
I second - I'm seeing similar behavior when connecting via Remote Desktop, in this case to a computer running R2010a. In my case I restart Matlab to get the Editor back in line.

Haoran Xu

unread,
Aug 22, 2014, 11:30:08 PM8/22/14
to
"Alan Jennings" wrote in message <ifi67c$3l1$1...@fred.mathworks.com>...
Same here!
Remote desktop control. Matlab 2012a. Line number missing now and then.
I close all opened tabs in editor, and reopen them to fix the problem.
Hope engineers fix it once for all.

Brian

unread,
Dec 8, 2014, 11:50:15 AM12/8/14
to
"Yair Altman" wrote in message <l34bk9$fg2$1...@newscl01ah.mathworks.com>...
> similar behavior when connecting via Remote Desktop, in this case to a computer running R2010a.

Version R2014b: problem persists. Triggered by using Remote Desktop.

Christopher Wong

unread,
Apr 21, 2015, 7:22:15 PM4/21/15
to
"Brian" wrote in message <m64krv$9i$1...@newscl01ah.mathworks.com>...
> "Yair Altman" wrote in message <l34bk9$fg2$1...@newscl01ah.mathworks.com>...
> > similar behavior when connecting via Remote Desktop, in this case to a computer running R2010a.
>
> Version R2014b: problem persists. Triggered by using Remote Desktop.

Version 2015a still has the same problem as well, triggered by using Windows Remote Desktop on Windows 7 Professional.

Jeremy

unread,
May 6, 2015, 7:56:58 AM5/6/15
to
Although an old thread, I found a simple solution that works for me: just toggling the View>Split Document setting will make the line numbers reappear.

I'm using R2013b, so depending on the version, you might need to search elsewhere for this option, or you could try different viewing options.

Also, a lot of posts were pinpointing the source of the problem being remote desktop, which I do not use but still have this problem. However, I do change from workplace almost each day, meaning I work with lots of different monitors. Could it have something to do with the change in resolution settings? This could also be triggered by the remote desktop?

Yair Altman

unread,
May 7, 2015, 7:03:03 AM5/7/15
to
"Jeremy" <j.j.h....@student.tue.nl> wrote in message <micvi6$qag$1...@newscl01ah.mathworks.com>...
> Although an old thread, I found a simple solution that works for me: just toggling the View>Split Document setting will make the line numbers reappear.
>
> I'm using R2013b, so depending on the version, you might need to search elsewhere for this option, or you could try different viewing options.
>
> Also, a lot of posts were pinpointing the source of the problem being remote desktop, which I do not use but still have this problem. However, I do change from workplace almost each day, meaning I work with lots of different monitors. Could it have something to do with the change in resolution settings? This could also be triggered by the remote desktop?


This is bug which occurs when the display properties change. Remote Desktop is an example of this; other examples include using high contrast mode, changing the system's look and feel, and in your case - changing screen resolution. MathWorks are aware of this problem.

Yair Altman
http://UndocumentedMatlab.com

Image Analyst

unread,
May 7, 2015, 10:27:05 PM5/7/15
to
"Yair Altman" wrote in message
> This is bug which occurs when the display properties change. Remote Desktop is an example of this; other examples include using high contrast mode, changing the system's look and feel, and in your case - changing screen resolution. MathWorks are aware of this problem.
>
> Yair Altman
> http://UndocumentedMatlab.com
>
===================================================
Another example is when you do a webex session, like when Mathworks Tech Support is helping you on your computer.
- Image Analyst

Ryan Curtis

unread,
May 8, 2015, 1:00:06 PM5/8/15
to
"Yair Altman" <altma...@gmailDEL.comDEL> wrote in message <mifgp2$i01$1...@newscl01ah.mathworks.com>...
> This is bug which occurs when the display properties change. Remote Desktop is an example of this; other examples include using high contrast mode, changing the system's look and feel, and in your case - changing screen resolution. MathWorks are aware of this problem.
>

MathWorks have apparently been aware of this problem for at least a couple of years. Certainly when I reported the issue a year and a half ago, I was informed it was a known issue. It's disappointing that it hasn't been fixed yet, and I'm starting to wonder if ever will get fixed.

I often keep one to two dozen files open in the editor, and I often want to use Remote Desktop to work, and every time I have to weigh the benefit of getting work done over Remote Desktop against the pain of having to go through every file in the editor and either re-open it or toggle the Split Document to get Code Analyzer colors and line numbers. I usually have a lot of data already in the workspace, so closing and re-opening MATLAB is painful. And I have to go through this twice, once after I connect over Remote Desktop, and again when I'm back in the office after disconnecting Remote Desktop.

--Ryan

Bryan

unread,
Aug 6, 2015, 2:27:19 PM8/6/15
to
"Ryan Curtis" <rcur...@blueorigin.delXs.com> wrote in message <miiq2h$iu6$1...@newscl01ah.mathworks.com>...
I reported this same problem to Mathworks over 5 years ago. They told me at the time it was a known issue and indicated it happens when screen resolution changes. I wish they would spend some effort on fixing this annoying issue.

In the meantime, I have made my own script to workaround this issue. This script is run every time I experience the problem. It determines all open files, closes them, then opens them back up again in the same order.

Q = matlab.desktop.editor.getAll;
for idx = 1:numel(Q)
file_names{idx} = Q(idx).Filename;
end
Q.close();
for idx = 1:numel(file_names)
edit(file_names{idx})
end

-Bryan

Adrian

unread,
Jan 15, 2016, 8:07:13 AM1/15/16
to
The following solution worked for me in Matlab R2014b (without need to close Matlab or all editor windows):

1. Activate one of the editor windows.
2. In the "SPLIT DOCUMENT" group of the "VIEW" menu click on "Left/Right" or "Top/Bottom". Then click on "None".
3. After this, the line numbers will be shown on the left.
4. Repeat steps 1-4 for alle open editor windows. (That may be the hard part.)

Hope it works for you as well.

BTW: I had used RemoteDesktop before, which might have caused the problem in the beginning.

Adrian

unread,
Jan 15, 2016, 8:26:09 AM1/15/16
to
"Adrian" wrote in message <n7aqtn$nuo$1...@newscl01ah.mathworks.com>...
I just see that I got a Java error when applying the solution described in my post cited above. The Java error does not seem to be critical, which means that the Matlab session can hopefully be continued without any problems. As a workaround to avoid this Java error, instead of step 2. in my post above, the following action may be taken:

2'. In the editor window, at the top of the scroll bar on the right, an upward pointing arrow is visible. Immediately above that arrow, a small dark gray region was visible in my case. Continue as follows:
Either: a) Double-click on the dark gray region, so the current editor window will be split into two parts of identical height. Double-click on the borderline between the two editor window regions in order to switch to single window view.
Or: b) Hold an pull the dark gray region down as far as possible, i.e. by a few millimeters. The current editor window will then be split into two parts, with the upper part having zero height, so it is not actually visible. Hold and pull the upper border of the visible editor region fully up in order to switch to single window view.

I think by these measures the Java error can be avoided.


For Matlab developers: This is the Java error I have received:

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at com.mathworks.widgets.SyntaxTextPaneMultiView$DragButtonMouseListener.mouseDragged(SyntaxTextPaneMultiView.java:1449)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

Matthias

unread,
Apr 27, 2016, 4:22:14 PM4/27/16
to
The original message about this issue was posted on 30 Dec, 2010. It is now April 2016 and I'm using Matlab 2016a and the issue is still not fixed. MathWorks, please attend to this basic issue!

Xiangrui Li

unread,
Jun 6, 2016, 1:57:08 PM6/6/16
to
I am experiencing the same problem here. This seems to happen to me only when remote desktop is used. And if I remember correctly, it happens to me only about a month ago, while I have been using remote desktop for a long time.

As others have suggested, my solution was to restart matlab after switching between local and remote use.

If this is not ideal due to lot variables in the work space, one can try the editor window split mode change proposed in an early post, but this seems only to make line numbers appear for one of the files, so it is annoying to do this for each file.

A much better way is to close and reopen files as proposed in an early post. Here I made that code look a little simpler. You can save these lines as an m file, and run it. It works very well for me.

%___________
Q = matlab.desktop.editor.getAll;
file_names = {Q.Filename};
Q.close();
edit(file_names{:});
%___________

For sure, we would expect Mathworks will fix this in the future.

-Xiangrui

Saeed Ashrafinia

unread,
Oct 4, 2016, 1:10:16 PM10/4/16
to
Thanks Adrian. This works.
I have had the same issue with most of Matlab versions, because I'm connecting remotely using Windows Remote Desktop. And it's really not acceptable that the bug is there after more than 10 version updates!
Mathworks; please fix this.


"Adrian" wrote in message <n7aqtn$nuo$1...@newscl01ah.mathworks.com>...

Saeed Ashrafinia

unread,
Oct 5, 2016, 10:50:08 AM10/5/16
to
Update: The issue is still there in version 2016b!!
Not only the line numbers vanish, but also variable names highlight in the right side of the screen doesn't work. Still the fix is to split, and turn it back.

"Saeed Ashrafinia" wrote in message <nt0npj$14j$1...@newscl01ah.mathworks.com>...

dpb

unread,
Oct 5, 2016, 10:55:24 AM10/5/16
to
On 10/04/2016 12:10 PM, Saeed Ashrafinia wrote:
> Thanks Adrian. This works.
> I have had the same issue with most of Matlab versions, because I'm
> connecting remotely using Windows Remote Desktop. And it's really not
> acceptable that the bug is there after more than 10 version updates!
> Mathworks; please fix this.
...

Well, have you filed a formal bug report on the issue? newsgroups and
the forum are _NOT_ official support channels. Use the links at
<www.mathworks.com>

Benjamin Spencer

unread,
Dec 7, 2016, 10:14:11 PM12/7/16
to
"Sepideh" wrote in message <k7sdsc$1e8$1...@newscl01ah.mathworks.com>...
> There is this very small hollow space in the left bottom corner of the editor window that you need to drag to the right so that the line numbers show. They are just hidden and you can't see them! :) I think this happens when some of you use remote desktop just because of the monitor size difference.



This worked for me, thanks.

Eric Keller

unread,
Aug 8, 2017, 3:38:19 PM8/8/17
to
"dpb" wrote in message <nt3488$q2j$1...@dont-email.me>...
> Well, have you filed a formal bug report on the issue? newsgroups and
> the forum are _NOT_ official support channels. Use the links at
> <www.mathworks.com>

I'm just curious how many bug reports they actually need? They aren't fixing it due to the first 20, why would a 21st have any effect?
0 new messages