Can variable renaming tooltip be disabled?

I know that the variable/function renaming behavior can be disabled entirely. That's not my goal. I use the feature all the time, but the popup/tooltip constantly gets in the way and I'd like to know if there's any hope of disabling just the message.
I imagine the answer is no, but I might as well ask.

3 Kommentare

Adam Danz
Adam Danz am 29 Mär. 2021
I'm intrigued. What is the variable/function renaming tooltip? Asking for a friend. 🤣
DGM
DGM am 29 Mär. 2021
Bearbeitet: DGM am 29 Mär. 2021
I'm referring to the popup message associated with the automatic variable and function renaming feature that was introduced circa R2011b. If you click on a variable name on the LHS of an assignment and start changing the variable name, you'll get a message that says "Press shift-enter to rename $num instances of 'thisvariablename' to 'thatvariablename'".
It's under preferences > editor > language > variable and function renaming.
Adam Danz
Adam Danz am 29 Mär. 2021
Ah ok. My mind was elsewhere. Thanks.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Adam Danz
Adam Danz am 30 Mär. 2021
Bearbeitet: Adam Danz am 30 Mär. 2021

0 Stimmen

I don't know how to disable just the message while maintaining the ability to rename all using shift+enter.
You could create a shortcut that temporarily sets the EnableVariableAndFunctionRenaming property to off until it's turned back on or until Matlab closes and restarts but that will also disable the shift+enter option.
function toggleRenamingProperty(TF)
% TF is either true|false.
% false turns off the EnableVariableAndFunctionRenaming property.
% true turns it back on. Restarting matlab negates any changes.
S = settings;
S.matlab.editor.language.matlab.EnableVariableAndFunctionRenaming.TemporaryValue = TF;
end
I'd bet that the message could be disabled with some java wizardry.

5 Kommentare

DGM
DGM am 31 Mär. 2021
Yeah, the "java wizardry" possibility was kind of what I was imagining. I didn't really think of using a shortcut, but now that you mention it, that might just work well enough. I use the feature, but I tend to be very cautious and deliberate about it. Needing to explicitly enable the functionality is something that's not really at odds with that behavior.
Thank you.
Adam Danz
Adam Danz am 31 Mär. 2021
Yeah, what makes the function my answer a bit safer is that it only chagnes the TemporaryValue so that even if the feature is not toggled back on before shutting down matlab, it will return to its default value when matlab restarts.
Adam Danz
Adam Danz am 31 Mär. 2021
@DGM, I ran into this blog post today from Yair Altman's blog. I didn't have time to sift through it but it may be helpful.
DGM
DGM am 1 Apr. 2021
Hmm. I'll check that out, but I admit, most of his blog tends to go over my head.
Adam Danz
Adam Danz am 1 Apr. 2021
I played around with it a bit and it seems to only affect tooltips on graphics objects.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2015b

Gefragt:

DGM
am 29 Mär. 2021

Kommentiert:

am 1 Apr. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by