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 件のコメント

Adam Danz
Adam Danz 2021 年 3 月 29 日
I'm intrigued. What is the variable/function renaming tooltip? Asking for a friend. 🤣
DGM
DGM 2021 年 3 月 29 日
編集済み: DGM 2021 年 3 月 29 日
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 2021 年 3 月 29 日
Ah ok. My mind was elsewhere. Thanks.

サインインしてコメントする。

 採用された回答

Adam Danz
Adam Danz 2021 年 3 月 30 日
編集済み: Adam Danz 2021 年 3 月 30 日

0 投票

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 件のコメント

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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2015b

質問済み:

DGM
2021 年 3 月 29 日

コメント済み:

2021 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by