Select the same line in both views of cloned document.
-
You didn’t elaborate on the magic number of “8”…would have been appreciated.
-
or maybe the OP already explained the 8.
I found that with the script as written, the sync-up won’t happen until one of the cloned-doc views is adjusted horizontally, e.g. the horizontal scroll bar is moved. This is OK to me. I will keep this script close at hand for future need.
-
@Alan-Kilborn, sorry @jcg3675 is right, it is the value for horizontal scroll changes.
-
Hello @jcg3675, @ekopalypse, @alan-kilborn and All,
I found out a weird but minor bug related to the Smart Highlighting when a file is cloned in the secondary view. Of course, @ekopalypse, this post does not refer to your python script at all, ( script that I have not tested it yet, BTW ! )
To begin with, some hypotheses :
-
N++ version :
v7.8.3
-
No extra plugin installed, just the
3
default ones -
Options ticked in
Preferences... > Highlighting > Smart Highlighting
:Enable
,Match whole word only
andHighlight another view
. All the other options un-ticked -
Disable the multi-line tabs feature by un-ticking the option
Preferences... > General > Tab Bar > Multi-line
=>1
row of tabs, only ! -
The Horizontal splitter between primary and secondary is selected. If not, simply right-click on the splitter and choose the
Rotate to left
option -
Default zoom is used, both, in primary and secondary view (
Ctrl + Numpad /
) -
No horizontal nor vertical synchronization of the two views. So, un-tick the options
View > Synchronize Vertical Scrolling
andView > Synchronize Horizontal Scrolling
-
For readability, enable the line numbers column, in
Preferences... > Editing > Display line number
Now :
-
Open a new tab
-
Hit the
Enter
key to create20
empty lines -
Then , append
10
lines containing the stringABCDE
( so, from lines21
to30
) -
End with
2
empty lines ( lines31
and32
) -
Save it as
Test.txt
-
Select the option
View > Move/Clone Current Document > Clone to Other View
=> The cloned documentTest.txt
is located at bottom of screen -
Move line
16
as the first line in the secondary view -
Now, select the original
Test.txt
tab, on top of screen -
In the same way, move line
16
as the first line of the primary view -
Double-click on line
23
of the primary view => The ten linesABCDE
, in each view, are highlighted, as expected -
Then, while keeping the mouse pointer over the primary view, scroll down , with the mouse wheel ( or with the vertical bar ) , until no text is present => Only the visible line(s) of the primary view is/are highlighted in the secondary view !
-
Now, scroll up, with the mouse wheel, until no text is present => In the same way, only the visible line(s) of the primary view is/are highlighted in the secondary view !
Remarks :
-
If, without changing the active top tab ( primary view ), we place the mouse pointer over the secondary view and scroll up/down, with the mouse wheel, nothing is changed in the primary view and the ten lines are always highlighted
-
If we stop and re-start Notepad++ with the
Test.txt
displayed in each view, this minor bug still occurs -
I also noticed this behaviour, with the old N++
7.2
version, which was the first release which included theHighlight another view
option, regarding the Smart Highlighting feature ! -
Although not tested, I suppose that the recent
v7.8.4
version does produce the same bug
Important :
-
Instead of cloning the file
Test.txt
, in the secondary view, let’s create a copy of the fileTest.txt
, namedCopy.txt
-
Open this new file, in the secondary view, with the option
View > Move/Clone Current Document > Move to Other View
-
This time, if we repeat the above steps, whatever the visible lines
ABCDE
, in the primary view, obtained by scrolling text up or down, the ten linesABCDE
of the identical fileCopy.txt
are always highlighted, in the secondary view, as expected !
Best Regards,
guy038
-
-
@guy038 said in Select the same line in both views of cloned document.:
this minor bug
Should you also do THIS with it?
-
I discovered something similar when using the new method multipleSelectAddNext.
If I use your test and having in the top view only two occurrences of the word ABCDE visible, placing the caret within the first visible word ABCDE and I run editor.multipleSelectAddNext(), it only selects the two visible lines.
The documentation states, that it does that for the current target. Now it might be, that either scintilla or npp set the visible lines as the current target automatically, or that this is a bug. Needs to be checked.
-
-
Hello, @jcg3675, @ekopalypse, @alan-kilborn and All,
So, with some delay, I created an issue on GitHub :
Cheers,
guy038
-
@Ekopalypse Well I am more of a microwave dinner and Ramen noodle kind of guy at the moment, being a college student and all :)
But I do have a suggestion–my family makes Lithuanian cracker stuffing a couple of times a year for the big holidays. My dad’s side has made it every year since they came to America in the 1910s.
The recipe that I linked is pretty accurate, but there are a few modifications:
Replace chopped giblets with diced turkey bacon bits
Replace saltine crackers with milk crackersAnd that should do it. Let me know how it goes!
-
@jcg3675
Thank you very much and yes, there is time when a microwave becomes the best invention since sliced bread :-)Let me know how it goes!
I sure will do.