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 commentaires

Adam Danz
Adam Danz le 29 Mar 2021
I'm intrigued. What is the variable/function renaming tooltip? Asking for a friend. 🤣
DGM
DGM le 29 Mar 2021
Modifié(e) : DGM le 29 Mar 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 le 29 Mar 2021
Ah ok. My mind was elsewhere. Thanks.

Connectez-vous pour commenter.

 Réponse acceptée

Adam Danz
Adam Danz le 30 Mar 2021
Modifié(e) : Adam Danz le 30 Mar 2021
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 commentaires

DGM
DGM le 31 Mar 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 le 31 Mar 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 le 31 Mar 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 le 1 Avr 2021
Hmm. I'll check that out, but I admit, most of his blog tends to go over my head.
Adam Danz
Adam Danz le 1 Avr 2021
I played around with it a bit and it seems to only affect tooltips on graphics objects.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Produits

Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by