Double clicking code sometimes select the whole line (2021b?)

8 ビュー (過去 30 日間)
Fernando Zigunov
Fernando Zigunov 2021 年 11 月 15 日
回答済み: david machacek 2023 年 8 月 23 日
Hi, I've recently upated to Matlab 2021b and this has been bothering me for a while. Typically in text editors, double-clicking some word will select the whole word, and that is also true of Matlab. However, it appears that the recent Matlab update implemented some sort of full-line selection with conditions that are rather obscure and it feels to me like bad UX.
Not gonna lie, this is rather annoying and it makes me want to roll back the update as it does disrupt my train of thoughts as I code. From what I observed, if you have already selected a whole word with a double-click, and then you double-click another different word, then the next word you double-click will select the full line instead of only the word that was clicked.
A use case that annoys me a lot is when I'm copying a piece of code and replacing a variable with a different variable name in multiple locations by Ctrl-V'ing the variable name to the new locations. Then it'll select the whole line and I'll erase the entire line of code as I press Ctrl-V, ending up frustrated.
Is there a fix for this? Maybe a setting I can deactivate? And no, I don't want automatic replacing of variable names in my codes; thanks.
  1 件のコメント
Benjamin Tessler
Benjamin Tessler 2023 年 7 月 25 日
編集済み: Benjamin Tessler 2023 年 7 月 25 日
Has there been any updates on this bug? It's been hurting my productivity. (I'm using 2023a and it's happening to me)

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

回答 (3 件)

Pranjal Kaura
Pranjal Kaura 2021 年 12 月 29 日
Hey Fernando,
Thank you for bringing this up. I have heard that this issue is known and the corresponding parties are investigating it further and will try to fix it in future releases.

david machacek
david machacek 2023 年 8 月 23 日
I have the same issue and it makes my innermost melt with frustration!!!

Akash Singh
Akash Singh 2021 年 12 月 8 日
Double click selects the word.
Triple click selects the line, this change has been implemented in MATLAB 7.9 (R2009b) in order to allow a line of code to be selected, dragged, and inserted in a new position in a MATLAB file.
  2 件のコメント
Fernando Zigunov
Fernando Zigunov 2021 年 12 月 8 日
You did not understand my question at all. This is not about triple click. It's about a double click being incorrectly interpreted as a triple click.
Try this:
Say we have the dumb code below:
SomeOtherVariable = 5;
Variable1 = Variable2 + Variable3;
Variable2 = Variable2 - Variable3;
Variable3 = Variable2 * Variable3;
Variable4 = Variable2 / Variable3;
Variable5 = Variable2 ^ Variable3;
Now say you want to change the Variable2 entries to SomeOtherVariable, but only in lines 2, 5 and 6 (i.e., replace all doesn't apply). Follow the exact sequence below, as fast as you can, to reproduce the issue:
  1. Double-click SomeOtherVariable in line 1.
  2. Press Ctrl+C to copy it to the clipboard;
  3. Double-click Variable2 in line 2.
  4. If your delay between Step 2 and Step 3 is <~200-300ms (maybe it depends on the local processor), it will select the entire line, as if a triple click was sent.
  5. You can keep reproducing the issue: Press Ctrl+V to replace the Variable2 with the clipboard contents;
  6. Now double-click Variable2 in line 5. It again selects the entire line if the sequence happens fast enough.
If you are too slow, simply go through the exercise of replacing all Variable2 entries to the clipboard contents by double-clicking and then Ctrl-V. You will eventually find out what I mean.
Key is: It is an annoying bug because it only happens if you're clicking fast. But that's exactly how fast I (and likely others) operate when you're in the flow, coding. It is frustrating because it breaks the flow!! This is something to do with Matlab R2021. I've already downgraded to R2018 in my machine, because this bug single-handedly drives me nuts.
Alex Chang
Alex Chang 2022 年 6 月 3 日
Still appears to occur in Matlab 2022a - is a very agitating (I presume) bug.
Running on Ubuntu 16.04 LTS. Can confirm this behavior does not occur in other text editors, only the Matlab GUI.

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

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by