Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gilgamech opened this issue Jan 21, 2024 · 20 comments
Closed

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

Gilgamech opened this issue Jan 21, 2024 · 20 comments

Comments

@Gilgamech
Copy link

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.

@alankilborn
Copy link
Contributor

Note: Step 2 should say Ctrl+h, not Ctrl+r.


I think setting this avoids the above problem:

image

although, doing that may cause other problems with some different workflows (haven't thought about that too much).

@Gilgamech
Copy link
Author

Yes, Step 2 should say Ctrl+H.

In the above image, mine has 1024. I'm not sure of the impact of changing this setting.

I suppose, as a feature request, a checkbox for "Disable auto-checking 'In-Selection'". Ultimately I want the checkbox to only change when I click it.

@alankilborn
Copy link
Contributor

alankilborn commented Jan 22, 2024

Ultimately I want the checkbox to only change when I click it

For pure manual control:
image


I'm not sure of the impact of changing this setting.

In addition to the balloon help shown above, this is described in user manual: https://npp-user-manual.org/docs/preferences/#searching (near the top of the linked section).

@Gilgamech
Copy link
Author

Thanks for posting that. It didn't pop up when I clicked it on mine.

@alankilborn
Copy link
Contributor

It didn't pop up when I clicked it on mine.

You just hover to get the popup balloon; you don't click the button with the ? on it.

@Gilgamech
Copy link
Author

That's a very unusual design decision that doesn't fit with the rest of the application. Why have a one-off note that's contained within a hover element that resembles a button? Why not either just display this normally, or have the hover element be a button? It feels like extra effort went into making this information hard to access.

Feature request: Replace the hover element with box always displaying this text. It's too useful of a note to be hidden behind an unusual and awkward element.

@Gilgamech Gilgamech reopened this Jan 22, 2024
@alankilborn
Copy link
Contributor

... doesn't fit with the rest of the application

There are several other buttons-with-hover like that throughout the application.
There's some limitation with having hover text appear, say, when you point to the edit box itself, so the ? button is a UI compromise.


Feature request: Replace the hover element with box always displaying this text. It's too useful of a note to be hidden behind an unusual and awkward element.

I'm fairly confident your changed feature request (which should have been a new and different issue) will be rejected.

@Gilgamech
Copy link
Author

There are several other buttons-with-hover like that throughout the application.

They're Tooltips. Why isn't this also?

I'm fairly confident your changed feature request (which should have been a new and different issue) will be rejected.

While your advice is appreciated, your pessimism isn't.

@alankilborn
Copy link
Contributor

While your advice is appreciated, your pessimism isn't.

realism? :-)


They're Tooltips. Why isn't this also?

If you think it is reasonably easy to do, go ahead and give it a shot as Notepad++ accepts user-contributed code changes.

@Gilgamech
Copy link
Author

Gilgamech commented Jan 22, 2024

It's possible to indicate that a feature request should have its own issue without invoking the other sentiments.

If you think it is reasonably easy to do, go ahead and give it a shot as Notepad++ accepts user-contributed code changes.

Yes, I was debating this - given the issue to PR ratio, the efficacy of this path is dubious, and the timeline doubly-so.

Edit: This appears to be bad advice. From CONTRIBUTING.md:

If you want to make some GUI enhancement like renaming some graphic items or fixing typos, please create the issue instead of the pull requests. All Pull Requests, except for translations and user documentation, need to be attached to a issue on GitHub. For Pull Requests regarding enhancements and questions, the issue must first be approved by one of project's administrators before being merged into the project. An approved issue will have the label Accepted. For issues that have not been accepted, you may request to be assigned to that issue.

So first I'd need to make an issue, then wait for an administrator to approve, then request for it to be assigned and have that fulfilled. THEN I could submit a PR.

@lukemim
Copy link

lukemim commented Mar 22, 2024

I'm still experiencing this problem in version 8.6.4 when "minimum size for auto-checking" is not 0: when I make a first replacement in selection and then select another text the checkbox appears to be still checked, but when I click replace all it gets unchecked and the replacement occurs even outside of the selection. Setting minimum size for auto-checking to 0 only works around this bug, but the bug is still there.

@alankilborn
Copy link
Contributor

I'm still experiencing this problem in version 8.4.6

I presume you mean 8.6.4

@lukemim
Copy link

lukemim commented Mar 22, 2024

yes, sorry about that, fixed

@alankilborn
Copy link
Contributor

alankilborn commented Mar 22, 2024

when "minimum size for auto-checking" is not 0

So, what is the value you have set for this?
Please give more detailed steps-to-reproduce the entire scenario you are seeing.

@lukemim
Copy link

lukemim commented Mar 22, 2024

the value that was there before I set it to 0 was 1024. The steps are the same as in the original description, it's the same bug

@Gilgamech
Copy link
Author

when "minimum size for auto-checking" is not 0

So, what is the value you have set for this? Please give more detailed steps-to-reproduce the entire scenario you are seeing.

Could you stop harassing other users for making simple bug reports? You act like this is your castle but it's not. I'd report your comments as bullying if the option were available.

@alankilborn
Copy link
Contributor

alankilborn commented Mar 22, 2024

@Gilgamech said:

Could you stop harassing other users for making simple bug reports?

Harassing?? I see it as attempting to solicit further information in order to replicate/understand the another user's scenario for a bug report. @lukemim 's situation must be different from yours because you wanted "full manual control" and I provided instructions for how to obtain that.

You act like this is your castle, but it's not.

Wrong on the first part of that, correct on the second.
@donho wears the crown around here.

I'd report your comments as bullying if the option were available.

I just did it myself (by addressing donho). He can decide if I'm a "bully" or not.
What I'm simply trying to do is fully understand user concerns about a feature I was involved in, and coded for.

Since you (Gilgamech) stopped adding to the original conversation, and went off on some tangent about hover tooltips, I presumed that the solution I gave you was satisfactory ( #14624 (comment) )

@Gilgamech
Copy link
Author

What I'm simply trying to do is fully understand user concerns about a feature I was involved in, and coded for.

You do this with the grace of a person swatting flies with a hammer

And thank you for ceding the point through your ad hominem attack. Beyond making me feel unwelcome in this open source project, and giving bad advice, you're making me want to change IDEs and stop recommending this software product. Is this intentional?

@alankilborn
Copy link
Contributor

@lukemim Do you have anything more to say on this topic?

@lukemim
Copy link

lukemim commented Mar 25, 2024

thanks for creating #14897

I suppose a part of the problem is that the checkbox gets automatically checked or unchecked based on the selection size by default without any obvious indication - I had no idea such functionality is enabled by default.

Besides that a good UX solution might be to have separate buttons for "replace all" and "replace in selection"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants