Is multi-caret editing bugged?
-
With Settings > Preferences > Editing > ☑ Enable Multi-Editing (Ctrl+Mouse click/selection) checkmarked on, when I create multiple carets and try to move with the arrow key, it moves all the carets at the same time.
As Alan wrote while I was typing this up, you need to give us more to go on – including the ?-menu’s Debug Info, for example:
Notepad++ v8.4.2 (64-bit) Build time : May 29 2022 - 16:47:30 Path : C:\usr\local\apps\npp\npp.8.4.2.portable.x64\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 20H2 OS Build : 19042.1586 Current ANSI codepage : 1252 Plugins : mimeTools (2.8) NppConverter (4.4) NppExport (0.4)
I am curious whether you really had a multi-click-based Multi-caret, or if you accidentally used the Alt+Click+Drag to make a column selection – and without the BetterMultiSelection plugin, the column-selection will not move with arrows like Ctrl+Click multi-selection does.
-
Indeed. My multiple carets are created with shortcut ALT + SHIFT + UP.
Is there a reason to have “column selection” not built on multi-caret logic?
It is quite confusing to me. From end user perspective, they should be the same thing. -
Is there a reason to have “column selection” not built on multi-caret logic?
They are completely separate features, implemented separately with different purposes. That’s why they use different keystrokes to activate them (and the preference that you have to enable to get Multi-Editing is pretty explicit about what keystroke activates that feature, as is the Edit > Column Mode which informs you how to make a column selection).
That said, if you want Column Editing (the Alt+selection) to work more like Multi-Editing (Ctrl+Click), then install the BetterMultiSelection plugin: with that plugin installed, column selection will allow you to arrow around just like Multi-Editing does.
-
The BetterMultiSelection works although I don’t know why there is a keyboard shortcut to Column Mode but not the multi-caret mode. I tested that the Column/Multi-selection Editor. It also work on carets created with multi-carets. It seems to me the generic multi-caret can do everything Column Mode provide except it just missing a keyboard shortcut to spawn caret up/down. There seems to be no reason for the special “column mode” to exist.
Anyway, I notice when I undo something, the existing multiple-carets will get cancelled. This behaviour cause the user to have to recreate the extra carets.
Thanks
-
@earth-invader said in Is multi-caret editing bugged?:
t seems to me the generic multi-caret can do everything Column Mode provide except it just missing a keyboard shortcut to spawn caret up/down.
This interpretation is wrong on two counts.
First:
generic multi-caret can do everything Column Mode provide
Nope. The two are different modes, each with unique features. This animated screenshot shows some of the unique capabilities
Second:
except it just missing a keyboard shortcut to spawn caret up/down.
The arrow key isn’t “spawning” caret up/down in multi-edit mode, so claiming that the column mode is “missing” a shortcut to “spawn” caret up/down is showing a misunderstanding on your part.
When you have multiple carets due to multi-selection mode, you have multiple cursors and multiple selections on which you are doing the same thing – some of those things include the ability to move all those cursors simultaneously
However, when you have a column selection, you have a single selection (and it is implemented as such) and there is one tall caret that is always in the same column for every row of the rectangular selection. If it were possible to arrow that tall caret around, it would be extremely likely that you would quickly get into a situation where it would try an impossibility (arrowing right beyond the EOL on the top row while there are still characters left on subsequent rows: would you want the tall-caret to wrap to the next line, or extend beyond the end of the first line: and if you want one, I can guarantee that another user would equally vehemently want it the other way; with some thought, you can find many other such conflicts or impossibilities or difficulties).
To sum up this portion: the Column Mode and Multi-Select mode were added to accomplish different goals, and have different feature sets; neither mode can 100% replicate the features of the other, and as such, the developers would be alienating users of one to combine it into the other and claim that “it’s close enough to the same”.
But I doubt this rebuttal was effective on you (though I hope otherwise), and I am quite confident that any rebuttal that you make from this point on will be equally ineffective on me. So I will try to bow out of this portion of the conversation.
----
However, you were right when you said,
I notice when I undo something, the existing multiple-carets will get cancelled.
Indeed, it can cancel the multi-selection: I can see how that might be annoying. If you don’t like it, the Forum has a FAQ which explains where to submit an official bug report – because as fellow Notepad++ users, there is nothing that those of us who frequent the forum can do to change the codebase. If you do submit a bug report, keep it limited to that actual bug (“doing a multi-edit selection, making an edit, and then undoing part of the edit causes Notepad++ to leave multi-edit mode, forcing users to redo the multiple carets”); if you include your other complaints in the same issue, the issue as a whole is likely to get ignored, and that won’t do you any good to get the undo-cancels-multi-select fixed.
-
@peterjones said in Is multi-caret editing bugged?:
…when you have a column selection, you have a single selection…
Wellll… :
But it does know the difference, via :
If you don’t like it, the Forum has a FAQ which explains where to submit an official bug report – because as fellow Notepad++ users, there is nothing that those of us who frequent the forum can do to change the codebase.
This would probably end up needing to be a Scintilla request, I’d think.
-
Thanks for the explanation. I am not suggesting to merge column mode. I just doubted the existence of the the column mode as I don’t know the usefulness of the column mode before your show the demo and I think its good to have both of them.
The only thing I would like to see improvement is that there is no keyboard shortcut to create new carets like the column mode. People wanting to use multi-carets editing with keyboard shortcut are forced to use column mode with BetterMultiSelection plugin. That doesn’t feel like the right way to do it.
-
@earth-invader said in Is multi-caret editing bugged?:
The only thing I would like to see improvement is that there is no keyboard shortcut to create new carets like the column mode
But this doesn’t make any sense. How would you get your caret to the second position you’d want it placed using the keyboard? As soon as you start “arrowing” to start moving to the second position, you’ve moved the first place. Or is there yet another “mode” that would be invented to allow one to specify this? Seems complicated; let’s keep multi-selection as a mouse-only operation.
-
I suppose it just like how Column Mode works but in multi-caret mode instead?
like
Ctrl+Alt+ Up to spawn a caret above.
Ctrl+Alt+ Down to spawn a caret below.
both without moving the current caret.Isn’t this how many other text editors works?
e.g. Visual Studio, Sublime, you name it. -
@earth-invader said in Is multi-caret editing bugged?:
I suppose it just like how Column Mode works but in multi-caret mode instead
But that only works for the limited subset of multi-caret where those carets all start in a single column on adjacent rows. My screenshot example of putting the caret at the three
|
(which are not in the same column and can have lines in between that don’t contain the cursor) cannot reasonably* be done with keyboard only.If you want to convert a column selection to be a multi-selection (which is what BetterMultiSelection does in your use case), then use BetterMultiSelection – that’s one of the features it gives.
Some editors choose to implement every possible feature themselves (or forbid the feature altogether if they don’t want to implement it). Some choose to allow plugins to implement features that the main developers doesn’t feel like implementing. This discrepancy between users’ desires on the Column vs Multi-selection is why the Notepad++ have allowed plugins to customize things like this – because there won’t be agreement, and the developer doesn’t always think a feature belongs in the main application.
-
@earth-invader said in Is multi-caret editing bugged?:
Ctrl+Alt+ Up to spawn a caret above.
Ctrl+Alt+ Down to spawn a caret below.
both without moving the current caret.Isn’t this how many other text editors works?
e.g. Visual Studio, Sublime, you name it.I have never heard of this, so I jumped over to my already-running Visual Studio 2019 and tried it. Ctrl+Alt+up (or down) does nothing, so unless it is some special mode you have to enable (took a quick look at Text Editor Options but didn’t see it), the answer is Not for me.
I don’t know about Sublime, and I’ve never noticed such a thing in any other text editor I’ve used, and I’ve been using them since 1995.
And, total truth be told, I see little value in multi-carets (that aren’t part of a column block specification). Ok, well maybe if you want to Ctrl+click in several places and then start typing and have the same thing appear everywhere…but by the time I’ve done all that clicking around I might as well have just typed my text in place #1, copied it (by my custom word-yank macro), moved to place #2 and pasted it, moved to place #3 and pasted it, etc. Pretty much the same amount of clicking.
-
By the way, I now know that Ctrl+Alt+down on my setup by default flips the orientation on one of my screens … never knew this… :-)
-
Sorry my bad, Ctrl+Alt+Up/Down is the shortcut of sublime. VS shortcut is as shown above (if I haven’t changed it).
The main different of using mouse click and keyboard shortcut is that user can press and hold to spawn a lot of carets without keep clicking.
By the way, I now know that Ctrl+Alt+down on my setup by default flips the orientation on one of my screens … never knew this… :-)
O_o
-
@earth-invader said in Is multi-caret editing bugged?:
Isn’t this how many other text editors works?
e.g. Visual Studio, Sublime, you name it.Nope.
Ctrl+Alt+Up and Ctrl+Alt+Down do no such thing in Visual Studio, or in Notepad++ with BetterMultiSelection btw. (In VS, it seems to be accessing the little tabbar down arrow)
Alt+Shift+Up and Alt+Shift+Down start a column-mode selection in both Notepad++ and in Visual Studio. And in Visual Studio, after making a selection in column mode, if I right arrow or up arrow, it leaves column-mode selection mode and goes back to just moving a single cursor, which is exactly what Notepad++ does without the BetterMultiSelection:
(this screenshot was made without BetterMultiSelection plugin)
In my tests, NPP and VS do the same thing with that sequence.
-
Alt+Shift+Up and Alt+Shift+Down start a column-mode selection in both Notepad++ and in Visual Studio. And in Visual Studio, after making a selection in column mode, if I right arrow or up arrow, it leaves column-mode selection mode and goes back to just moving a single cursor, which is exactly what Notepad++ does without the BetterMultiSelection:
Probably because you are using an old version. ^_^"
I can 't post gif here so I uploaded it to google drive.
It now support everything I mentioned. Can also undo without leaving multi-caret.
-
Can you ever make a post that contains complete information on a point??
You hint that Peter is using an “old version” (of Visual Studio) but you don’t specify what “non-old” version you are using.
Nobody wants to (or can) access your google drive, so I can’t see what point you’re trying to make there.
You show a partial GUI of VS, but it took me a while to find the same thing in it (I’m not an expert user of VS for editing, as I prefer N++, so I don’t know its setup well); here’s a more complete UI for others that have it and might be interested (start with the Tools > Customize… menu command):
I pretty much agree with Peter’s prior statements. Anyway, the bottom line is I really still don’t understand what you are talking about; sorry to say (and I think I’ve put the effort in for trying to understand).
-
@alan-kilborn said in Is multi-caret editing bugged?:
You hint that Peter is using an “old version” (of Visual Studio)
I’m sure I do – we use a 2017 at work, and I knew there was a 2019 after (and when I looked it up after seeing the post, there is also a 2022 version, apparently). So I shouldn’t be surprised that there are new features; sorry for my out-of-date information.
And once again, in case I wasn’t clear enough for @Earth-Invader:
- The Notepad++ developers have made it quite clear that they are perfectly happy to leave certain features in the hands of plugin developers; since BetterMultiSelection makes column+multi-select work more like you expect multi-select to work based on your “modern VS” (and presumably Sublime) experience, then use that plugin.
- If the “undo without leaving multi-caret” is important to you, report the bug in the appropriate location, as described in the FAQ, as that is the only way that anything will have a chance of being done about it.
-
@peterjones said in Is multi-caret editing bugged?:
we use a 2017 at work, and I knew there was a 2019 after (and when I looked it up after seeing the post, there is also a 2022 version, apparently). So I shouldn’t be surprised that there are new features; sorry for my out-of-date information.
But I highly doubt that 2017 would not have the same keyboard setup choice – maybe an ancient version – wait, I’ll check, I also have VS2008 – time passes while he looks it up… – even that “old” version has it:
-
But I highly doubt that 2017 would not have the same keyboard setup choice
Sorry, I guess I wasn’t clear: VS 2017 has column selection mode, which is what
Edit.LineUpExtendColumn
does.The point that I believe @Earth-Invader was trying to make about my older VS is that the unknown newer version of VS which @Earth-Invader uses apparently makes the VS column-selection mode have more features, so that it behaves more like the Notepad++&BetterMultiSelection combo.
So, for VS2017 and plain-Notepad++, the sequence of
Shift+Alt+DownArrow Shift+Alt+DownArrow Shift+Alt+DownArrow Shift+Alt+RightArrow Shift+Alt+RightArrow
will create a rectangle 4rows x 2columns, thenRight Arrow
will take you out of column/multi-selection and have a single cursor at the bottom-right corner of that original rectangle:
Contrariwise, in Notepad++ with BetterMultiSelection (and according to the shared video which I was able to see from home last night, but not at work now, in VisualStudio SecretNewerVersion), doing
Shift+Alt+DownArrow Shift+Alt+DownArrow Shift+Alt+DownArrow Shift+Alt+RightArrow Shift+Alt+RightArrow
will still create a rectangle 4rows x 2columns, but in that setup,Right Arrow
will not take you out of column/multi-select but will move the tall multi-line cursor:
-
That is an interesting response.
Let me write the whole thing again.
I am stating that notepad++ is doing something stupid because
instead of providing a keyboard shortcut to spawn NORMAL multi-caret on the lines above/below, it only provide shortcut to spawn new carets in the special broken column mode which cannot move across letters smartly without the BetterMultiSelection plugin.I stated that it can be improved by just adding a keyboard shortcut to spawn NORMAL multiple carets like most of the code editors do. Once shortcut is available, instead of requiring user to install extra BetterMultiSelection to fix the Column Mode, user can just config the shortcut and start keyboard based multi-caret editing with smart caret navigation across letters.
The reason to have keyboard shortcut instead of mouse click?
Its way more convenient and precise when coding. Can hold down the keys and keep spawning carets on many lines. e.g. adding/removing prefix on a very large enum or array elements.I say that most code editor works like that. after that, you guys, instead of focusing on the idea itself, trying to verify whether I am making things up by testing multi-caret in VS but with an old version and claiming that VS is doing as bad as current notepad++. I kindly telling you guys that you are not using the current version of VS to have a fair comparison. I don’t know about your circle but in my circle when people are told they should not use the old version, it is common sense to update a software to the current version. Finally you start to complaint I am not telling you what version of visual studio I am using while you are the one who start to test multi-caret in visual studio by yourself. I don’t expect to test VS in the 1st place nor do I expect you to test with an old version. From my perspective, testing particularly in visual studio is no necessary. I just suggest to have np++ to rise the current standard (multi-caret in this case). Whether it is in VS or Atom or Sublime or XCode, developer should think critically whether a feature/improvement should be added, not to blindly follow a particular software. When you need to test a feature from another software, it is common practice to compare to the latest most polished version.
I waste my time to record a gif to demo the new VS multi-caret editing but because this stupid forum not allow normal registered user like me to upload GIF, I have no choice but to upload to external hosting like google drive. I posted a link for you convenience so that you don’t need to install latest version of VS. However you instead of simply click the link and view it, claimed nobody wants to and able to access my google drive. I honestly don’t know what to say.
I am very sad.
Good bye