Multi to single selection after tab switch
-
Not seeing this issue mentioned in a quick search of forums or docs, though I may not have stumbled onto the right combination of terminology, or looked through old enough posts. Not sure it’s even necessarily a newish issue. Basically, if I do multi-selection of text (CTRL + left mouse button + drag) in an open file, then switch to another open NPP file tab and back, only the last continuous text string remains selected.
Debug info:
Notepad++ v8.3 (32-bit)
Build time : Feb 3 2022 - 03:35:48
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 7 Ultimate (64-bit)
OS Build : 7601.0
Current ANSI codepage : 1252
Plugins : BetterMultiSelection.dll ComparePlugin.dll DSpellCheck.dll ElasticTabstops.dll ExtSettings.dll MathPad.dll mimeTools.dll MultiClipboard.dll NppCalc.dll NppConverter.dll NppExport.dll NPPJSONViewer.dll NppTextFX.dll NppXmlTreeviewPlugin.dll PythonScript.dll RegexTrainer.dll SessionMgr.dllSame thing also happens when I run without plugins.
-
I just confirmed on v8.2.1. In fact, just toggling from file1 to file2 and back will remove the multi-selection from file1; you don’t have to even select anything in file2 or even click inside it.
But in an interesting twist, it only happens if they are in the same view. If file1 is in view1 and file2 in view2, then you can switch back and forth without it affecting the multi-selection in either.
Based on those experiments, my interpretation is that each Scintilla editor instance can only keep track of multi-selection in the active (forward) buffer; once you change buffer, Scintilla appears to clear the multi-selection flags it uses. (I haven’t delved into the guts of Scintilla to confirm; this is just a working theory).
Secondary confirmation: I fired up SciTE 4.46 (which matches the modern Notepad++'s scintilla version), and created two tabs, and it does the same thing; the multi-selection goes away if I navigate to tab2 and back to tab1. And even if I’m wrong as to the behind-the-scenes reason, this points to it being an implementation-detail/feature/bug of Scintilla 4.46, not of Notepad++ itself.
-
If that behavior really bothers you (I don’t get the feeling it does – all that much), probably something could be scripted to “fix” it.
Of course, putting in a bug report is also a possibility.
Another interesting semi-related one is if you Begin Select in one tab and End Select in another tab, you get interesting results. (Begin / End Select isn’t “tab aware”).
-
@peterjones said in Multi to single selection after tab switch:
this points to it being an implementation-detail/feature/bug of Scintilla 4.46, not of Notepad++ itself.
Sounds logical to me.
@alan-kilborn said in Multi to single selection after tab switch:
If that behavior really bothers you (I don’t get the feeling it does – all that much)
Nah — not so far, anyway. This was probably the first time I’d ever switched tabs immediately after creating a multi-selection.
I’m thinking this may warrant mentioning as a limitation in the docs, though.