Tab completion in R2015b; bug or feature?
1 view (last 30 days)
Show older comments
The behavior of tab completion in R2015b has changed w.r.t. R2014b. I have a class called Example and an instance (of Example) called example. When I type exam and press tab, R2014b completes to example (and shows that Example and example exist), but R2015b completes to Example (and shows that Example and example exist). Subsequently, I have to press the down arrow key to select example. This is extremely annoying (as I have many such classes and instances, having long names). I checked the tab completion options in both of my Matlab versions and these are equal. By the way, this also works for variables having the same names but different capitalization. Try "example = 1; Example = 2; eXample = 3; EXample = 4;" and explore the differences in tab completion when typing exam or Exam in R2015b and R2014b. This might or might not occur also in R2015a. I would guess this is a bug. Or is it a feature?
1 Comment
Guillaume
on 22 Sep 2015
Whichever version of matlab, tab completion has never worked properly for a reason or another.
I assume this issue has come about in an attempt to fix the fact that if you only had Example defined and started to type exam matlab would complete to example, keeping the case you originally typed even though the lower case variable didn't exist.
As an aside, I'm not sure it's a good idea to have variable / class / anything only differentiated by case. Looks like a good source of bugs.
Accepted Answer
Steven Lord
on 22 Sep 2015
My guess is that the change in behavior you see is related to item 3 in the Desktop section of the Release Notes for MATLAB release R2015b:
"Tab Completion: Complete commands with corrected capitalization"
Having two identifiers (example and Example) that differ only by case is likely, in my experience, to lead to confusion and a difficult to debug problem down the line.
2 Comments
Ken Atwell
on 24 Sep 2015
Edited: Ken Atwell
on 24 Sep 2015
I'm a developer in this area.
New to R2015b, tab completion will correct capitalization. For example: If you had only "Example" defined, and you type/complete "exam", MATLAB will capitalize the "E" for you. Older versions of MATLAB will not find any completion.
This works great in many situations, but I now see how this can accidently work against what N. Otime is doing, namely using case as an important "distinguisher" in the name. You've given us something to think about and consider for a future release, thanks.
Sorry, there is no way to turn off this behavior.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!