Skip to content

Commit 6970756

Browse files
committed
Add items to copy marked text, clear marks in view and clear marks in open documents to the Tools menu. Some tools menu items renamed, hopefully improving clarity. Disable some items when there is nothing to which to apply them. Update version info.
1 parent 3f31c68 commit 6970756

File tree

6 files changed

+275
-41
lines changed

6 files changed

+275
-41
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Search++: An enhanced search plugin for Notepad++
22

3-
## Version 0.5.1 --
3+
## Version 0.5.1 -- April 5th, 2026
44

55
* Fix Select Before and After not working.
66
* Enhance clearing behavior (whether implicit or checked in Settings dialog): don't clear selections, unmark text or hide lines if no matches are found.
7-
* Fix Mark -> Selections including an extra, empty selection.
7+
* Fix Select Marked Text (formerly Mark -> Selections) on Tools menu including an extra, empty selection.
8+
* Add items to the Tools menu to copy marked text and to remove marks from open documents and documents in this view. Rename some items, hopefully making them more clear. Disable some items when there is nothing to which to apply them.
89

910
## Version 0.5 -- April 2nd, 2026
1011

help.htm

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,23 +280,28 @@ <h3 id="search-tools">Tools</h3>
280280

281281
<p>The <strong>Tools</strong> button opens a menu that offers some convenient actions you might want to use in conjunction with searching:
282282

283+
<table>
284+
<tr><th>Hide All Lines</th><td>hides all lines in the active document.</td></tr>
285+
<tr><th>Show All Lines</th><td>shows all lines in the active document.</td></tr>
286+
<tr><th>Add Selection to Marked Text</th><td>marks all text currently selected in the active document with the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog. The default marker is the <em>Find Mark Style</em>, the same marker used by the built-in <strong>Search</strong>|<strong>Mark</strong> dialog in Notepad++.</td></tr>
287+
<tr><th>Select Marked Text</th><td>selects all text in the active document that is marked with the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog. Note that this does not add to the current selection; the current selection is lost.</td></tr>
288+
<tr><th>Copy Marked Text
283289
<ul>
284-
285-
<li><strong>Hide All Lines</strong> hides all lines in the active document.
286-
287-
<li><strong>Show All Lines</strong> unhides all lines in the active document.
288-
289-
<li><strong>Selections 🡪 Marked Text</strong> marks all text that is currently selected in the active document. (By default, <strong>Search++</strong> uses the “Find Mark Style” marker, the same one used by the <strong>Mark</strong> tab of the Search dialog in Notepad++. You can change the marker in the Search++ settings.)
290-
291-
<li><strong>Marked Text 🡪 Selections</strong> selects all text that is currently marked in the active document.
292-
293-
<li><strong>Unmark All Text</strong> removes the marker <strong>Search++</strong> is using from all text in the active document.
294-
295-
<li><strong>Clear search results list</strong> removes all results currently accumulated in the search results list.
296-
297-
<li><strong>Settings...</strong> opens the Search++ <a href="#settings">Settings</a> dialog.
298-
299-
</ul>
290+
<li>with no separators
291+
<li>separated by blanks
292+
<li>separated by tabs
293+
<li>separated by line breaks
294+
<li>separated by custom string
295+
</ul></th><td>copies to the clipboard all text in the active document that is marked with the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog as if it were a single selection. The separator, if any, that will be added between separate runs of marked text is indicated; the default is <strong>line breaks</strong>, which you can change using the next menu option.</td></tr>
296+
<tr><th>Copy Marked Text...</th><td><p>opens a dialog in which you can choose how you would like separate runs of marked text to be separated, and then copies all marked text in the same way as the option above. The separator you choose becomes the new separator for the menu option above.</p>
297+
<p class=note>If you choose <strong>Custom</strong>, you can enter a string of text you prefer: for example, you might want to use a comma followed by a blank to separate items that will go into a list. You can use <code>\t</code>, <code>\r</code> and <code>\n</code> for tabs, returns and new lines; use <code>\\</code> for a backslash before <code>t</code>, <code>r</code> or <code>n</code>. Note that in practice, you don’t need to worry about how you code a line ending unless you will be pasting somewhere other than Notepad++; when pasting in Notepad++ line endings are always converted to the line ending type set for the current document.</p></td></tr>
298+
<tr><th>Copy Marked Text as multiple selections</th><td>copies to the clipboard all text in the active document that is marked with the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog as if it were a multiple selection. This affects how the copied text pastes, since it will paste like a column or multiple selection rather than like a single selection. The separator for multiple selections is always a line break.</td></tr>
299+
<tr><th>Remove Marks from active document</th><td>removes from the current document all marks in the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog.</td></tr>
300+
<tr><th>Remove Marks from all open documents</th><td>removes from all open documents all marks in the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog. You might want to use this along with the <strong>Mark in Open Documents</strong> command.</td></tr>
301+
<tr><th>Remove Marks from documents in this view</th><td>removes from all documents in the currently active view all marks in the mark style chosen in the <a href="#settings-marked-text">Settings</a> dialog. You might want to use this or the next option along with the <strong>Mark in Documents in this View</strong> command.</td></tr>
302+
<tr><th>Clear search results list</th><td></td></tr>
303+
<tr><th>Settings...</th><td></td></tr>
304+
</table>
300305

301306
<h3 id="search-keyboard">Keyboard navigation</h3>
302307

src/CommonData.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ NLOHMANN_JSON_SERIALIZE_ENUM(SearchEngine, {
4040
{SearchEngine::ICU , "ICU" }
4141
})
4242

43+
enum class CopyMarkedSeparator {None, Blank, Tab, Line, Custom};
44+
NLOHMANN_JSON_SERIALIZE_ENUM(CopyMarkedSeparator, {
45+
{CopyMarkedSeparator::None , "none" },
46+
{CopyMarkedSeparator::Blank , "blank" },
47+
{CopyMarkedSeparator::Tab , "tab" },
48+
{CopyMarkedSeparator::Line , "line" },
49+
{CopyMarkedSeparator::Custom, "custom" }
50+
})
51+
4352
NLOHMANN_JSON_SERIALIZE_ENUM(Scintilla::Wrap, {
4453
{Scintilla::Wrap::None , "none"},
4554
{Scintilla::Wrap::Word , "word"},
@@ -84,6 +93,9 @@ inline struct CommonData {
8493
config<bool> clearMarked = { "unmark before mark" , false }; // IDC_SETTINGS_CLEARMARKED
8594
config<bool> hideBeforeShow = { "hide before show" , false }; // IDC_SETTINGS_HIDEBEFORESHOW
8695

96+
config<CopyMarkedSeparator> copyMarkedSeparator = { "copy marked separator" , CopyMarkedSeparator::Line };
97+
config<std::string> copyMarkedSeparatorText = { "copy marked separator text", "" };
98+
8799
config_history historyFind = { "find history" , {}, 12, config_history::Blank };
88100
config_history historyRepl = { "replace history", {}, 12, config_history::Blank };
89101

0 commit comments

Comments
 (0)