multiple line edit is not allowed on MATLAB file editor window?
Mostrar comentarios más antiguos
Hi,
Emacs, Sublime text and Visual studio, etc. They all have multiple line edit.
If you do not know what I mean, please see this video at : https://www.youtube.com/watch?feature=player_embedded&v=qp2WuJ2rEE4
Can we do that?
9 comentarios
dpb
el 23 de Oct. de 2015
Well, I don't know it by that description but why don't you tell us what you mean instead of expecting us to go somewhere else?
Dario Mangoni
el 26 de Sept. de 2016
I cannot believe that such a useful feature is not implemented in Matlab editor. It is really a shame! And going on a different text editor it's only a workaround, not a solution.
@dpb: Taekyu Shin explained perfectly what "multiple line edit" stands for: with a video!
And that is by far the best explanation one could give. But anyway: this is a textual description, if clicking on a link had given you some troubles.
Multiple line edit is the feature that allows you to select a slot of text spanning different lines (usually with Alt+click key) so that they can be modified alltogheter. Usually also multiple-cursors-on-different-columns is supported so that the multiple cursors are not forced to lay on the same column.
A nice video should have work better... but this would have forced you to go "somewhere else". Poor...
Joseph Hall
el 8 de Mzo. de 2019
I would love for Matlab to support this feature. Please implement it soon.
Steven Lord
el 8 de Mzo. de 2019
Marco Pastore
el 21 de Mzo. de 2019
It would be a killer feature if implemented in the Matlab Editor, thank you!
Simon Beck
el 5 de Mzo. de 2021
It really would be a very useful feature!
please consider it in future releases.
Walter Roberson
el 17 de Feb. de 2022
In new-enough MATLAB releases, the traditional editor has been replaced by the live editor, so rectangular editing is now supported.
Prakash Singh Badal
el 4 de Jun. de 2022
Editada: Prakash Singh Badal
el 4 de Jun. de 2022
In case someone stumbled on this thread, following is the exact answer on how to do it. Note the use of mouse with alt and not keyboard (unlike usual editors).
Respuestas (4)
Dario Mangoni
el 26 de Sept. de 2016
I would upvote 1billion times this question. Matlab is a so powerful tool that is really becomed lame for its lacking-features Editor.
Together with multiediting, it lacks also of the "duplicate line" feature.
@dpb: Follows a textual description: "Duplicate line" feature allow to duplicate the line you are on, usually pressing Ctrl+D. e.g.
disp('I like textual descriptions')
... pressing Ctrl+D while the cursor is on that line gives
disp('I like textual descriptions')
disp('I like textual descriptions')
Please, don't ask us why this feature is "really useful".
1 comentario
dpb
el 27 de Sept. de 2016
In Brief, numeric keypad '+' copies the current line to buffer and then numeric keypad 'Insert' pastes that buffer (line). Unfortunately for me, the Brief emulation in VS is incomplete and some keystrokes aren't allowed to be remapped at all so it's pretty-much useless.
My question before wasn't anything about whether whatever was/wasn't useful; simply didn't recognize the desired functionality by the description. And, it's certainly much quicker to simply read a simple description than have to go watch a video...and if it takes a video to explain it, I don't care enough and undoubtedly don't use it so don't have anything to add! :)
Stefan de Groot
el 23 de Abr. de 2019
1 voto
Dear Mathworks,
Any update on this feature request please!
Thank you!
Ken Atwell
el 24 de Oct. de 2015
0 votos
The MATLAB Editor does not have this, I think. Do you have an example MATLAB source file you can share with us where this kind of thing would be really useful to have?
4 comentarios
Dario Mangoni
el 26 de Sept. de 2016
The fact that vast majority of text editors has this feature should be enough to support the thesis that IS a useful feature.
Sure enough, it's not something that one cannot replace with tons of Ctrl+C Ctrl+V.
The video provides all the details, but anyway:
body1ref_glob = [1;0];
body2ref_glob = [0;1];
body3ref_glob = [1;1];
body4ref_glob = [2;1];
rotLG = [1, 0; 0, -1];
can you please write for me:
body<n>ref_loc = rotLG*body<n>ref_glob;
with multi-edit:
- multi-select body<n>ref_ that spans over 4 rows, copy&paste
- write loc after that (this will be done automatically on all the 4 new rows)
- copy&paste rotLG
- multi-select body<n>ref_glob, copy&paste
- press ; (this will be done automatically on all the 4 new rows)
Philip Pesce
el 7 de Abr. de 2021
Quote: "Do you have an example MATLAB source file you can share with us where this kind of thing would be really useful to have?"
LOL... every MATLAB file I've ever written in over the last 13 years of my career! I end up using Visual Studio Code or Notepad++ to end my MATLAB scripts because the MATLAB editor is awful. And not just because I can't multi-line edit.
Here's another example. Pretend I have the following lines and don't get hung up on having "myElementA" twice.
myBus.mySubBus.myElementA = 2.0;
myBus.mySubBus.myElementB = 3.0;
myBus.mySubBus.myElementA = myBus.mySubBus.myElementB;
If I singe left click myBus, the editor will highlight all four instances of myBus, because it's atthe begining of the line.
But if I single click on mySubBus, the editor is too stupid to recognize that this is used in four places and highlight all of them. Also true for myElementA and myElementB.
Other editors do this and make editing so much easier; MATLAB's editor is like using hammer and chissle.
Jaco-Louis Venter
el 19 de Mayo de 2021
The most common use I can think of for this feature would be to suppress multiple lines of code with a ;. During development, I leave many lines unsuppressed to make sure the output is what I expect. If I then tidy up my code, I have to spend quite some time inserting ; everywhere. With multi-select this would be a piece of cake.
Damir Rakhimov
el 17 de Feb. de 2022
Editada: Damir Rakhimov
el 17 de Feb. de 2022
I have one - when I need to change the same parameter in multiple scenarios simultaneously on different lines. Please check the attached file. I can use search and replace but the feature of editing multiple lines simultaneously is more handy - I use Sublime for this purpose at the moment. Also I would like to note that the attached example file is the small one, sometimes such files can contain up to fifty or more lines of configurations.
It would be great if such feature will appear in Matlab.
Jared MacDonald
el 25 de Ag. de 2022
0 votos
Please note that the MATLAB Editor has this feature as of R2021b. You can hold "Alt" or "Option" while clicking to make a multi-cursor block selection. Please see the "Edit and Format Code" section of the documentation for more information.
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!