notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

[BUG] Count (or FindNext) works, but FindAllinCurrDoc doesn't

Open
#15,779 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Is there an existing issue for this?
  • I have searched the existing issues
Description of the Issue

Please see STR (Steps to Reproduce), below.

Steps To Reproduce
  1. Create a new tab and add this text:
abc\r\n
123

def\r\n
456

abc\r\n
123

def\r\n
456
  1. Select lines 1 through 2 fully by clicking on the 1 in the line number margin and dragging downward to the 2; result:
    image
  2. Press Ctrl+f to invoke the Find window (Find what gets auto-populated with selected text)
  3. Setup the other find options as shown here:
    image
  4. Press Count; observe 2 occurrences counted (good)
  5. Without changing anything else, press Find All in Current Document
Current Behavior

Zero occurrences found:

image

Expected Behavior

2 occurrences (obviously)

Debug Information
Notepad++ v8.7   (64-bit)
Build time : Sep 17 2024 - 17:06:31
Path : C:\NotepadPlusPlus\Misc\_NoBackup\Releases\npp.8.7\npp.8.7.portable.x64\notepad++.exe
Command Line : -titleAdd="8.7 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.4317
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    PythonScript (2)
Anything else?

The STR were shown using the Count function, but correct searching behavior can be shown with Find Next instead by substituting this new step 5 for the step 5 in STR:

  1. Press Find Next repeatedly; observe that Notepad++ will find the data at lines 7 through 8, then 1 through 2, then 7 through 8, etc. (good)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Notepad++ using the Find window, selecting lines 1–2 and comparing Count with Find All in Current Document; Find Next provides a second comparison. Trace the Find window entry points for these commands and verify that Find All reports the same two occurrences as Count and Find Next.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.