<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[The << Find button has returned...sort of...and has brought friends]]></title><description><![CDATA[<p dir="auto">The <strong>&lt;&lt; Find</strong> button seemed to be a well-liked feature from Notepad++ 7.4.2…but sadly it was removed in Notepad++ 7.5.  The removal was a good thing because there were some problems with the feature as implemented.</p>
<p dir="auto">Read about how the &lt;&lt;FInd button had some fans:</p>
<ul>
<li><a href="https://notepad-plus-plus.org/community/topic/14320/make-find-next-find-prev-buttons-an-option" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14320/make-find-next-find-prev-buttons-an-option</a></li>
<li>and some of the posts here: <a href="https://notepad-plus-plus.org/community/topic/14315/notepad-7-5-release" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14315/notepad-7-5-release</a></li>
</ul>
<p dir="auto">Recently I made a 32-bit build (based upon N++ 7.5 sources) that adds the following buttons in the Find/Replace dialog:</p>
<ul>
<li><code>&lt;&lt; Find</code> and <code>Find &gt;&gt;</code> (restored)</li>
<li><code>&lt;&lt; Replace</code> and <code>Replace &gt;&gt;</code> (new buttons)</li>
<li><code>&lt;&lt; Repl All</code> and <code>Repl All &gt;&gt;</code> (new buttons)</li>
</ul>
<p dir="auto">Note: The <code>Backward direction</code> checkbox from 7.5 was removed from this build as it is no longer needed</p>
<p dir="auto">Here’s what this interface looks like:<br />
<img src="http://i.imgur.com/sEz0cYP.png" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Some details:</p>
<ul>
<li>
<p dir="auto">One of the logistical “problems” with having two <em>Repl All</em> buttons is that direction is meaningless if the <em>Wrap-around</em> or <em>In-selection</em> checkboxes are ticked…in which case there really should be only ONE <em>replace-all</em> button – direction doesn’t matter.  However, this (dynamically changing the UI to sometimes show one button) wasn’t done and pressing EITHER <em>Repl All</em> button is equivalent in these situations…</p>
</li>
<li>
<p dir="auto">Note that the <code>&lt;&lt;</code> buttons are disabled when regular-expression search-mode is enabled – this is intended behavior as searching backward in this mode has been disabled since around the time of version 6.3.</p>
</li>
<li>
<p dir="auto">The way macros regarding Find and Replace/All work is that the direction of the search is remembered separately from the command.  Breaking out Find, Replace, and ReplaceAll with 3 new “previous” buttons (the old buttons were just renamed as the “next” buttons) does not effect this scheme, i.e., no new commands are added to the command list–if a “previous” button is used during macro recording, the original command is recorded and the direction data is adjusted based upon the pressed button’s “direction”.  An example might help here:<br />
<strong>*</strong> If the “&lt;&lt; Find” button is pressed during macro recording, it is recorded as an (existing) “Find Next” command (ID=1) with direction encoded as “up”   (0 bit-weighting in the option mask)<br />
<strong>*</strong> If the “Find &gt;&gt;” button is pressed during macro recording, it is recorded as an (existing) “Find Next” command (ID=1) with direction encoded as “down” (512 bit-weighting in the option mask)</p>
</li>
<li>
<p dir="auto">Note: Reference find-macro info <a href="http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#Search_.2F_Replace_encoding" rel="nofollow ugc">here</a> but definitely notice that the 1702 option-flags table is wrong in that it bit-weights “up” as 512, not “down”!</p>
</li>
<li>
<p dir="auto">A bonus from keeping one command ID for two different commands is that find-related macros recorded with earlier versions of Notepad++ will work without any changes needed in this version.</p>
</li>
</ul>
<p dir="auto">If you are valiant you can try out this build; the best way to do so might be to:</p>
<ul>
<li>Grab a portable install of 7.5 from <a href="https://notepad-plus-plus.org/repository/7.x/7.5" rel="nofollow ugc">here</a> … look for file “npp.7.5.bin.zip” or “npp.7.5.bin.7z”</li>
<li>Unzip the portable install somewhere</li>
<li>Get my build of notepad++ from <a href="https://www.dropbox.com/s/u1u3mofdutacfs7/NPP_75_x86_Add3Btns2FindDlg.zip?dl=1" rel="nofollow ugc">here</a></li>
<li>Extract notepad++.exe from my build’s zip over the notepad++.exe in the folder where you unzipped the portable install</li>
<li>Run the new notepad++.exe</li>
<li>Do some finding and replacing!</li>
</ul>
<p dir="auto">I would have also made a 64-bit build, but for some reason building Boost for 64-bit doesn’t want to work on my machine (MSVC 2015 Community Edition).  :(</p>
<p dir="auto">I’d appreciate any feedback, even if you don’t actually try the build but just THINK about this new functionality…are these new button functions liked?</p>
<p dir="auto">If this gets some positive feedback, I’ll turn it into a real pull request…that could very well get ignored…but let’s be hopeful.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14372/the-find-button-has-returned-sort-of-and-has-brought-friends</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 08:04:22 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14372.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Aug 2017 12:29:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to The << Find button has returned...sort of...and has brought friends on Mon, 28 Aug 2017 01:32:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said:</p>
<blockquote>
<p dir="auto">I’ve just noticed one bug. Luckily, after checking on official versions, that’s NOT due to your version !</p>
</blockquote>
<p dir="auto">I agree with your findings.  The trouble seems to come from this section of the source code:</p>
<pre><code>CharacterRange cr = (*_ppEditView)-&gt;getSelection();

//The search "zone" is relative to the selection, so search happens 'outside'
int startPosition = cr.cpMax;
int endPosition = docLength;

if (pOptions-&gt;_whichDirection == DIR_UP)
{
    //When searching upwards, start is the lower part, end the upper, for backwards search
    startPosition = cr.cpMax - 1;
    endPosition = 0;
}
</code></pre>
<p dir="auto">The line causing the trouble is <strong>startPosition = cr.cpMax - 1;</strong></p>
<p dir="auto">When the caret is here (at the position marked by the vertical bar): <strong>abcabcabcabcABC|abcabc</strong> and the backwards search for “abc” (without regard to case) is invoked, the <strong>-1</strong> in the line above is what causes the search to begin at this position: <strong>abcabcabcabcAB|Cabcabc</strong> instead of at the correct starting point.  Thus, the first match that is found is the last “abc” just before “ABC” (as <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> indicated), instead of “ABC”.  This supposes that Scintilla’s searchInTarget() function (called later than the above snippet of code) won’t find matches that begin inside the specified range and extend outside the range.</p>
<p dir="auto">Unfortunately, I don’t see an easy fix to this.  If the line is changed to be <strong>startPosition = cr.cpMax;</strong> then “ABC” is correctly found as the first backward-search match, but repeated presses of the <strong>&lt;&lt;Find</strong> (my N++ build) or <strong>Find Next</strong> (real N++ 7.5) button will not move the caret, i.e., it will be stuck on “ABC” forever, instead of finding each preceding “abc” match in turn.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26481</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 28 Aug 2017 01:32:38 GMT</pubDate></item><item><title><![CDATA[Reply to The << Find button has returned...sort of...and has brought friends on Sun, 27 Aug 2017 15:05:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: scott-sumner">@<bdi>scott-sumner</bdi></a>,</p>
<p dir="auto">Bravo, <strong>Scott</strong> !! <strong>Nice</strong> implementation :-))</p>
<p dir="auto">I did some <strong>quick</strong> tests with the <strong>change.log</strong> file, searching for word <strong>Add</strong> and replacing with <strong>ABC</strong>, in both <strong>normal</strong> and <strong>Regular</strong> expression mode, <strong>with</strong> or <strong>without</strong> the <strong>wrap around</strong> option. Everything seems <strong>OK</strong> :-))</p>
<p dir="auto"><strong>Remark</strong> : I have <strong>not</strong> test any <strong>macro</strong>, yet, containing <strong>Search/Replace</strong> operations !</p>
<p dir="auto">I’ve just noticed one <strong>bug</strong>. Luckily, after checking on <strong>official</strong> versions, that’s <strong>NOT</strong> due to <strong>your</strong> version !</p>
<p dir="auto">Given, for instance, the string <strong><code>abcabcabcabcABCabcabc</code></strong> ( <strong>7</strong> times the string <strong>abc</strong> )</p>
<ul>
<li>
<p dir="auto">Place the <strong>cursor</strong> right <strong>after</strong> the part <strong><code>ABC</code></strong>, in <strong>upper</strong> case, of that string</p>
</li>
<li>
<p dir="auto">Open the <strong>Find</strong> dialog</p>
</li>
<li>
<p dir="auto">Type <strong><code>abc</code></strong> on the <strong>Find what:</strong> area</p>
</li>
<li>
<p dir="auto">Leave <strong>all</strong> the “box” options <strong>UN</strong>checked</p>
</li>
<li>
<p dir="auto">Check the <strong>Normal</strong> search mode</p>
</li>
<li>
<p dir="auto">Finally, click on the <strong>&lt;&lt; Find</strong> button</p>
</li>
</ul>
<p dir="auto">=&gt; It does <strong>not</strong> match the string <strong>ABC</strong>, as expected, but the <strong>previous</strong> string <strong>abc</strong> !  ( <strong><code>BUG</code></strong> )</p>
<p dir="auto">However, if the caret is located right <strong>after</strong> the string <strong>ABCa</strong> ( that is to say <strong>one more</strong> position to the <strong>right</strong> ! ), it <strong>does</strong> match the string <strong><code>ABC</code></strong>, in <strong>upper</strong> case !</p>
<hr />
<p dir="auto">And luckily, in <strong>forward</strong> direction, this bug does <strong>not</strong> occur !</p>
<ul>
<li>
<p dir="auto">Place the cursor right <strong>before</strong> the part <strong><code>ABC</code></strong>, in <strong>upper</strong> case</p>
</li>
<li>
<p dir="auto">Clicking on the <strong>Find &gt;&gt;</strong> button, N++ selects, as expected, the <strong><code>ABC</code></strong> string !</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26473</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26473</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 27 Aug 2017 15:05:55 GMT</pubDate></item></channel></rss>