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 Commenti

I'm intrigued. What is the variable/function renaming tooltip? Asking for a friend. 🤣
DGM
DGM il 29 Mar 2021
Modificato: DGM il 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.
Ah ok. My mind was elsewhere. Thanks.

Accedi per commentare.

 Risposta accettata

Adam Danz
Adam Danz il 30 Mar 2021
Modificato: Adam Danz il 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 Commenti

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Prodotti

Release

R2015b

Richiesto:

DGM
il 29 Mar 2021

Commentato:

il 1 Apr 2021

Community Treasure Hunt

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

Start Hunting!

Translated by