notepad-plus-plus / notepad-plus-plus

Notepad++ official repository

Home Page:https://notepad-plus-plus.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Search-results navigation incorrect when vertical scroll sync enabled

alankilborn opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

Double-clicking in Search results will not scroll the correct line into the user's view if the line occurs above the initial vertical sync point between the files (when the initial sync point on the secondary file was at top-of-file).

Steps To Reproduce

  1. Open the attached file a.txt into a Notepad++ tab
  2. Clone the file into the secondary view
  3. In the right (secondary) view, adjust the user viewport so that line 1 is the first line in your sight
  4. In the left (primary) view, adjust the user viewport so that line 101 is the first line in your sight
  5. Turn on vertical synchronized scrolling
  6. Play with the mouse wheel up and down; observe that the views vertically scroll simultaneously (as intended), with the left view always remaining 100 lines offset from the right view
  7. Make sure the left view is active
  8. Search for the text fair using Find All in Current Document to produce output in the Search results area
  9. Double-click a line in Search results that should cause a jump to a line >= 101 (result: success)
  10. Double-click a line in Search results that should cause a jump to a line < 101 (result: FAILURE!)

Current Behavior

For the failure case, the left view will scroll so that line 101 is the topmost line that the user sees. The caret is not visible to the user (the caret is actually with the selected search hit text on the earlier line).

Expected Behavior

The line with the hit properly scrolled into user's view.

Debug Information

Notepad++ v8.6.5   (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : C:\NotepadPlusPlus\Misc\_NoBackup\Releases\npp.8.6.5\npp.8.6.5.portable.x64\notepad++.exe
Command Line : -titleAdd="8.6.5 64-bit" -multiInst
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Pro (64-bit
OS Version : 23H2
OS Build : 22631.3447
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    PythonScript (2)

Anything else?

a.txt

First mentioned on the Community: https://community.notepad-plus-plus.org/topic/22820 (see March 21, 2024 and later postings).

if it can help, I list another example, but it is a little bit different

if 2 texts are vertically synchronized, the "find all results" on the secondary panel (the one on the right) doesn't go to the correct line

  1. open Italian.xml on the left and english.xml on the right
  2. add some lines in order to align the 2 text and save
  3. activate vertical scroll
  4. on the secondary (on the right) panel "find all" the character "&"
  5. enter the find all result
  6. click on a line (for example line 114): the text doesn't scroll
  7. if you find all in the left panel, the carret goes to the correct line

immagine

Notepad++ v8.6.7 (64-bit)
Build time : May 12 2024 - 20:04:00
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Home (64-bit)
OS Version : 23H2
OS Build : 22631.3593
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)