Skip to content

"In Selection" becomes unchecked on clicking "Replace All"  #14624

@Gilgamech

Description

@Gilgamech

Description of the Issue

The behavior of the In Selection checkbox is highly inconsistent. Usually it is in the wrong mode, so I'm used to clicking the checkbox after opening the Replace window. I understand that there is other logic that attempts to determine the correct mode, and am willing to work around that.

And until recently, the checkbox would remain the same as long as the dialog box is open. Now, after highlighting and replacing text in a section with the checkbox checked, highlighting another section (and without closing or modifying the Replace dialog) causes the In Selection checkbox to become unchecked. But the UI doesn't update until it gains focus again, which occurs when I click the Replace All button.

Steps to Reproduce the Issue

  1. Have a document with text in it. Highlight a multi-line section
  2. Press Ctrl+R to open the Replace window and check the In Selection checkbox.
  3. Highlight a section of text., and press Replace All.
  4. Highlight another section of text and press Replace All.

Expected Behavior

The replaceable text only within the selection would be replaced.

Actual Behavior

The replaceable text throughout the document was replaced.

Debug Information

Notepad++ v8.6.2 (64-bit)
Build time : Jan 14 2024 - 02:16:00
Path : C:\Program Files\n++\notepad++.exe
Command Line : "C:\repos\website\www\calc.md"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 22H2
OS Build : 22621.3007
Current ANSI codepage : 1252
Plugins :
AutoSave (1.6.1)
ComparePlugin (2.0.2)
mimeTools (3)
NppConverter (4.5)
NppExport (0.4)

I don't mind that the checkbox is usually in the wrong state. What I mind is that it changes state while the Replace window is open, and that its behavior continues to change. It seems as though Notepad++ is determined to always replace across the wrong set, necessitating a Ctrl+Z, re-check selection, re-check settings, and Replace All again. Which is an inefficient workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions