Skip to content

Style only the current selection/word, not all copies of identical text #9263

@sasumner

Description

@sasumner

Description of the Issue

When styling text using Search > Mark All > Using Nth style , I'd like to be able to color ONLY the text I currently have selected, or only the current word at the caret if no selection is active. This goes against the menu item's "Mark ALL" concept but in certain circumstances it can be valuable to do this. One circumstance is when copying styled text to the clipboard and wanting to avoid redundant data.

Some other user requests for this:

I alluded to the user needing this feature when I added the "Copy Styled Text" capability to Notepad++ via this issue and its PR: #8943 , specifically in these comments:

Steps to Reproduce the Issue

  1. Create some text in a Notepad++ tab:
Jack and Jill
Went up the hill
To fetch a pail of water
Jack fell down
And broke his crown,
And Jill came tumbling after.

Up Jack got
And home did trot,
As fast as he could caper;
And went to bed
And plastered his head
With vinegar and brown paper.

When Jill came in
How she did grin
To see Jack's paper plaster;
Mother vexed
Did whip her next
For causing Jack's disaster.
  1. Place the caret inside the word Jack in the first line
  2. Invoke Search menu > Mark All > Using 1st style
  3. Observe all occurrences of Jack are styled in the cyan color:
    image

Expected Behavior

I expected a way to have only the currently selected text, or the current word at the caret, to be styled with one of the five styling colors, not all prior and future instances of the text.

Actual Behavior

All occurrences of identical text were styled with the color I chose. This was not what I needed.

Debug Information

Notepad++ v7.9.1 (64-bit)
Build time : Nov 2 2020 - 01:07:46
Path : C:\...........\npp.7.9.1.portable.x64\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1577
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

Metadata

Metadata

Assignees

Labels

enhancementProposed enhancements of existing features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions