<?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[Bad Bracket Highlighter]]></title><description><![CDATA[<p dir="auto">Earlier, thanks to the people on this forum. We managed to make a line-final whitespace highlighter<br />
in pythonscript.</p>
<p dir="auto">So, I got the idea to modify this code to make it so that “bad brackets” that is brackets without closers or openers also get highlighted in a similar fashion.</p>
<p dir="auto">Link to my post is here:<br />
<a href="https://notepad-plus-plus.org/community/topic/15507/feature-request-show-only-line-final-whitespace/19" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/15507/feature-request-show-only-line-final-whitespace/19</a></p>
<p dir="auto">I will try to modify the script myself if I don’t get help, I don’t know how much success I will have with it. But, oh well.</p>
<p dir="auto">Thanks for the replies, cya.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16347/bad-bracket-highlighter</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 16:21:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16347.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Sep 2018 01:57:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sun, 05 May 2019 00:36:42 GMT]]></title><description><![CDATA[<p dir="auto">Ignore above, there were 2 syntax errors in there for some reason,<br />
and I fixed it. I must have made a mistake myself.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/42919</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/42919</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Sun, 05 May 2019 00:36:42 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 04 May 2019 05:15:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@Scott-Sumner</a></p>
<p dir="auto">Dear Scott.</p>
<p dir="auto">I am afraid this script and the broken bracket highlighter is no longer working.</p>
<p dir="auto">I confirmed that the startup script of the PythonScript plugin is working by using some other scripts.</p>
<p dir="auto">But, these 2 which are very similar to each other in nature, are just not working.</p>
<p dir="auto">I don’t know why, I tried fixing it and I could not. So, I have to appeal to you for help.</p>
<p dir="auto">:(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/42904</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/42904</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Sat, 04 May 2019 05:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Mon, 01 Oct 2018 15:54:03 GMT]]></title><description><![CDATA[<p dir="auto">Slight change to the Pythonscript I posted earlier.  I noticed that does not work correctly when the Notepad++ user executes a <strong>Save All</strong>.  Here’s an update to (only) the callback function part that will fix this, just replace the old <code>LERAS__callback_npp_FILEBEFORESAVE</code> function definition with the following:</p>
<pre><code class="language-z">def LERAS__callback_npp_FILEBEFORESAVE(args):
    notepad.activateBufferID(args['bufferID'])
    correct_eol_for_this_file = ['\r\n', '\r', '\n'][notepad.getFormatType()]
    editor.rereplace(LERAS__bad_eol_regex_via_good_eol_dict[correct_eol_for_this_file], correct_eol_for_this_file)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/35186</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35186</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 01 Oct 2018 15:54:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Wed, 26 Sep 2018 12:05:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a> said:</p>
<blockquote>
<p dir="auto">I want to cry with joy at this moment…</p>
</blockquote>
<p dir="auto">LOL.  …and I thought you’d complain that it isn’t an as-you-type or an as-you-paste solution!  I still wonder why mixed line-endings is a real problem for you.  I’ve been using Notepad++ for a long time and it rarely is a problem for me…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35101</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35101</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 26 Sep 2018 12:05:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Wed, 26 Sep 2018 10:51:12 GMT]]></title><description><![CDATA[<p dir="auto">I want to cry with joy at this moment…</p>
<p dir="auto">This is what makes notepad++ great…</p>
<p dir="auto">A special thanks to Scott as usual for his contribution.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35100</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35100</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Wed, 26 Sep 2018 10:51:12 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 19:46:18 GMT]]></title><description><![CDATA[<p dir="auto">So one way to avoid having mixed line-endings in your file is to automatically run a check each time the file is saved, and if any inconsistent line-endings are found, correct them at that time.  Here’s a Pythonscript that will do that; I call it <code>LineEndingRepairAtSave.py</code>:</p>
<pre><code class="language-z">try:

    LERAS__bad_eol_regex_via_good_eol_dict

except NameError:

    LERAS__bad_eol_regex_via_good_eol_dict = {
        '\r\n' : r'\r(?!\n)|(?&lt;!\r)\n',
        '\n'   : r'\r\n?',
        '\r'   : r'\r?\n',
    }

    def LERAS__callback_npp_FILEBEFORESAVE(args):
        correct_eol_for_this_file = ['\r\n', '\r', '\n'][notepad.getFormatType()]
        editor.rereplace(LERAS__bad_eol_regex_via_good_eol_dict[correct_eol_for_this_file], correct_eol_for_this_file)

    notepad.callback(LERAS__callback_npp_FILEBEFORESAVE, [NOTIFICATION.FILEBEFORESAVE])
</code></pre>
<p dir="auto">The idea is that you run it once per Notepad++ session and it will stand guard against the tyranny of mixed line-endings in your saved files.  Maybe it takes a noticeable amount of time to run on really large files…dunno…use at your own risk.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35089</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35089</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 25 Sep 2018 19:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 18:16:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a></p>
<blockquote>
<p dir="auto">very simple way</p>
</blockquote>
<p dir="auto">Yes, but ctrl+m is just a special case of <em>ALL</em> of the control-plus-(mostly)letter codes that one hasn’t assigned shortcut functions to.  The Pythonscript in that other thread takes care of all of them at once, so fat-fingered users should not see odd black-boxed things again in their editor window (like the picture at the bottom of this posting)…unless they Undo (ctrl+z) the change made by the script.  Sadly, I don’t believe there is a way to remove something from the undo buffer without purging the entire thing.  :-(</p>
<p dir="auto">It’s a more complete solution:  It takes care of the original problem of ctrl+m inserting a <code>\r</code> – without having to assign it a function, and some other things that a user may experience and not like.</p>
<p dir="auto">By the way, the script won’t interfere with things like ctrl+a or ctrl+c or ctrl+v, etc, because those (and your ctrl+m, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>) get snared as commands at a higher level and don’t pass through–like unassigned ones–to be added as “text” to the current editor window.</p>
<p dir="auto"><img src="https://camo.nodebb.org/47cc24d5254a3c78598199a7a30f581e54036217?url=https%3A%2F%2Fi.imgur.com%2FWiOKQim.png" alt="Imgur" class=" img-fluid img-markdown" /><br />
(those are ctrl+w and ctrl+e, respectively, as text)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35087</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35087</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 25 Sep 2018 18:16:59 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 17:55:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@salviasage</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@scott-sumner</a> and <strong>All</strong>,</p>
<p dir="auto">Oh, my God ! there a <strong>very simple</strong> way to prevent the <strong><code>Ctrl+ M</code></strong> shortcut from inserting the <strong>CR</strong> character ( <strong><code>\x{000D}</code></strong> ) , which is displayed in <strong>reverse</strong> video !.. Like me, simply, affect the <strong><code>Ctrl+ M</code></strong> shortcut to the <strong><code>Mark</code></strong> dialog ( <strong>Search &gt; Mark…</strong> ) :-)))</p>
<p dir="auto">Et voilà !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35086</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35086</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 25 Sep 2018 17:55:08 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 13:15:29 GMT]]></title><description><![CDATA[<p dir="auto">So as a prevention from pressing ctrl+m inserting a Mac line-ending into a non-Mac encoded file (as well as possibly ctrl+j inserting a Unix line-ending into a non-Unix encoded file), see the <code>CHARADDED</code> Pythonscript in <a href="https://notepad-plus-plus.org/community/topic/12901/shortcut-map-num-performs-function-but-also-adds" rel="nofollow ugc">this thread</a>.  This script should be set to be run upon Notepad++ startup.</p>
<p dir="auto">More comments to come on this topic…which unfortunately is off-topic for this thread (but I didn’t do that).  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35077</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35077</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 25 Sep 2018 13:15:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 12:41:45 GMT]]></title><description><![CDATA[<p dir="auto">BTW, pressing ctrl+j if you remove the default Notepad++ keymapping tying that to the <strong>Join Lines</strong> feature will insert a <code>\n</code> line-ending in the current file, regardless of the file’s EOL setting.  (This can be added to the previous posting’s bullet list)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35074</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35074</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 25 Sep 2018 12:41:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Tue, 25 Sep 2018 12:36:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a></p>
<p dir="auto">So the <strong>EOL Conversion</strong> feature only does something right at the time when you execute it.  It doesn’t set up any “real-time” or “as you type” monitoring to intercept whatever badness you choose to do and correct it.</p>
<p dir="auto">So files basically have a line-ending type as a convenience for the user.  You hit Enter and the correct line-ending is inserted.  You paste data from another source that has different line-endings and at the paste Scintilla sets the line-endings to match the destination’s EOL configuration.  It is basically a set-it-and-forget-it kind of thing.  HOWEVER, you can go around it, in a few ways (and probably more than this short list):</p>
<ul>
<li>Pressing ctrl+m when you haven’t remapped ctrl+m to something else (and you aren’t using Mac EOLs)</li>
<li>Doing a regex replace where your replacement text uses <code>\n</code> or <code>\r</code> or <code>\r\n</code> and the sequence you use doesn’t match your file’s current EOL choice</li>
<li>Pasting data using the <strong>Clipboard History</strong> panel when an entry there has line-endings that don’t match your file’s current EOL choice</li>
</ul>
<p dir="auto">So I’d think most people just avoid doing these things, and they don’t ever deal with the problem of mixed line-endings in one file…?</p>
<p dir="auto">May I ask why you are using ctrl+m in this way…or is this just something that you discovered will cause a mismatch and that is why you gave that as an example?</p>
<blockquote>
<p dir="auto">I am loving my regex macro because it does work real time</p>
</blockquote>
<p dir="auto">Rereading your most recent posting, I’m concerned that I am not understanding your “in real time” statement.  For example, how does your regex macro work in real time?  It is an on-demand thing…nothing happens until you run the macro…very much like the EOL conversion command.</p>
<blockquote>
<p dir="auto">I still can not detect the possible mixed line endings, without manually opening up the EOL display and looking through myself</p>
</blockquote>
<p dir="auto">I will try to think of some things that can be done about the mixed line-ending situation…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35073</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35073</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 25 Sep 2018 12:36:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Mon, 24 Sep 2018 23:14:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@Scott-Sumner</a></p>
<p dir="auto">The reason why I can not trust that built in function in notepad++ is because it simply does not work… at least it does not work real-time. I tried it.</p>
<p dir="auto">That is why, I am loving my regex macro because it does work real time, you can try it yourself by pressing ctrl+m to insert CR line, and then click on that, and the line won’t be converted.</p>
<p dir="auto">whereas my regex macro does convert everything properly.<br />
And yeah, now that I can save my regex as a macro (thanks for telling me how to do that) I don’t have to remember to type anything in the replace window.</p>
<p dir="auto">But, I still can not detect the possible mixed line endings, without manually opening up the EOL display and looking through myself (eek… what are computers for!!! )</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35065</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35065</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Mon, 24 Sep 2018 23:14:23 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Mon, 24 Sep 2018 20:47:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a> said:</p>
<blockquote>
<p dir="auto">if there are mixed line endings, I can change them all in a file to the ending I want using notepad++ replace command.</p>
</blockquote>
<p dir="auto">Why do this when you could simply use the <strong>Edit</strong> menu’s <strong>EOL Conversion</strong> submenu?  I’d suggest doing it that way (or via double-clicking on the line-ending area on the status bar)…less error prone…and you don’t have to remember the regex to do the desired conversion.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35061</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35061</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 24 Sep 2018 20:47:54 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sun, 23 Sep 2018 10:36:37 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@salviasage</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@scott-sumner</a> and <strong>All</strong>,</p>
<p dir="auto">I forgot an very <strong>IMPORTANT</strong> point about the <strong>free-spacing</strong> mode, which is introduced with the <strong><code>(?x)</code></strong> <strong>modifier</strong></p>
<hr />
<p dir="auto"><strong><code>A)</code></strong> IF your <strong>free-spacing</strong> pattern is a <strong>SINGLE</strong>-line regex, for instance :</p>
<pre><code class="language-diff">(?x) abc \r \n def \r \n ghi
</code></pre>
<p dir="auto">Then :</p>
<ul>
<li>
<p dir="auto">From your <strong>browser</strong>, copy the preferred <strong>regex</strong>, in the <strong>clipboard</strong>, with <strong><code>Ctrl + C</code></strong></p>
</li>
<li>
<p dir="auto">Then, you have the <strong>choice</strong> between <strong>two</strong> possibilities :</p>
<ul>
<li>
<p dir="auto"><strong><code>1)</code></strong> Open the <strong>Find</strong> dialog with <strong><code>Ctrl + F</code></strong> then paste, with <strong><code>Ctrl + V</code></strong>, the regex in the <strong><code>Find what:</code></strong> zone, which <strong>overwrites</strong> the <strong>present</strong> contents of the <strong>search</strong> zone</p>
</li>
<li>
<p dir="auto"><strong><code>2)</code></strong> Paste the regex, <strong>anywhere</strong> in a document or a <strong>new</strong> tab, then <strong>re-select</strong> the regex and open the <strong>Find dialog</strong>, with <strong><code>Ctrl + F</code></strong>, which, <strong>automatically</strong>, fill up the <strong><code>Find what:</code></strong> zone, with the MONO-line <strong>selection</strong></p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto"><strong><code>B)</code></strong> IF your <strong>free-spacing</strong> pattern is a <strong>MULTI</strong>-line regex, for instance :</p>
<pre><code class="language-diff">(?x)
abc \r \n
def \r \n
ghi
</code></pre>
<ul>
<li>
<p dir="auto">Like above, from your <strong>browser</strong>, copy the preferred <strong>regex</strong>, in the <strong>clipboard</strong>, with <strong><code>Ctrl + C</code></strong></p>
</li>
<li>
<p dir="auto">This time, you <strong>cannot</strong> paste the regex, directly, in the <strong>Find</strong> dialog, with <strong><code>Ctrl + V</code></strong> ! You <strong>must</strong> use the case <strong><code>2)</code></strong>. So :</p>
<ul>
<li>Paste the regex, <strong>anywhere</strong> in a document or a <strong>new</strong> tab, then <strong>re-select</strong> the regex and open the <strong>Find dialog</strong>, with <strong><code>Ctrl + F</code></strong>, which, <strong>automatically</strong>, fill up the <strong><code>Find what</code></strong> zone, with the <strong>correct</strong> MULTI-line <strong>selection</strong> !</li>
</ul>
</li>
</ul>
<p dir="auto">You may test, the <strong>single</strong>-line and <strong>multi</strong>-line regexes, with the <strong>sample</strong> text, below :</p>
<pre><code class="language-diff">abc
def
ghi
</code></pre>
<p dir="auto"><strong>Remark</strong> :</p>
<ul>
<li>The <strong><code>\R</code></strong> syntax, standing for <strong>any</strong> kind of <strong>EOL</strong>, is <strong>forbidden</strong> in <strong>free-spacing</strong> regexes. So, according to the <strong>type</strong> of your file, you’ll replace any <strong><code>\R</code></strong> pattern with <strong>one</strong> the syntaxes <strong><code>\r\n</code></strong> , <strong><code>\n</code></strong> or <strong><code>\r</code></strong> !</li>
</ul>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35037</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35037</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 23 Sep 2018 10:36:37 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 22 Sep 2018 21:02:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a> said:</p>
<blockquote>
<p dir="auto">how to turn these regex find and replace commands into 1 click macros</p>
</blockquote>
<p dir="auto">Well now THAT is super-easy.  Here’s how I like to do it:</p>
<ul>
<li>Set up your search or replace operation and test it using the Find dialog.  Include setting up all the fields and checkboxes as you want, of course</li>
<li>Use the toolbar button for starting a macro recording, or equivalently use the <strong>Macro</strong> (menu) -&gt; <strong>Start Recording</strong> menu option</li>
<li>Do one of the search or replace <em><strong>actions</strong></em>…(e.g., <strong>FInd Next</strong>, <strong>Replace</strong>, <strong>Replace All</strong>, etc.) – this is the <em><strong>only</strong></em> thing that you do that gets saved (in other words, you can change the <strong>Find what</strong> zone over and over but, even while macro recording is going on, these changes are not recorder–but they are recorded (as a group) when you do a search/replace <em><strong>action</strong></em>)</li>
<li>Use the toolbar button for ending a macro recording, or equivalently use the <strong>Macro</strong> (menu) -&gt; <strong>Stop Recording</strong> menu option</li>
<li>(Optional) Test your macro using the toolbar button for playback, , or equivalently use the <strong>Macro</strong> (menu) -&gt; <strong>Playback</strong> menu option…if it is not working right, start over with the first step</li>
<li>Name and save your macro using the  <strong>Macro</strong> (menu) -&gt; <strong>Save Currently Recorded Macro</strong> menu option</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/35035</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35035</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 22 Sep 2018 21:02:44 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 22 Sep 2018 19:47:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>, you seem to have a good understanding of regex. But I don’t and I am afraid I don’t understand you.</p>
<p dir="auto">I do understand that regex is important in the tasks that I am trying to accomplish here. For example, using a regex replace I have learned how to change line endings for example if there are mixed line endings, I can change them all in a file to the ending I want using notepad++ replace command.</p>
<p dir="auto">I also want to be able to detect the broken parenthesis in this manner and “jump” to them or highlight them by incorporating them into the highlighter python script that I already have here. Of course, we want to do this ideally with any opener, this will alert the user to missing 'end’s missing string quotes etc.</p>
<p dir="auto">I just think if these things could be highlighted it would be a great benefit to coders.<br />
I find coding so difficult and I like to have tools like these…</p>
<p dir="auto">Also, how to turn these regex find and replace commands into 1 click macros and things like that,<br />
So, I can easily click on my mixed line ending converter or other stuff easily.</p>
<p dir="auto">Thanks for the replies!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35034</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35034</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Sat, 22 Sep 2018 19:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 19 Nov 2022 09:28:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@salviasage</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@scott-sumner</a> and All,</p>
<p dir="auto">Thinking ( again ! ) about the <strong>matching pair</strong> problem, it’s really a <strong>tricky</strong> problem !</p>
<p dir="auto"><strong>1)</strong></p>
<p dir="auto">Consider that simple text below :</p>
<pre><code class="language-diff">{abc
(123)
[def(ghi)]
(jkl[mno])
(789)
pqr}
</code></pre>
<p dir="auto">Obviously, this text is <strong>well</strong> balanced. So, either,</p>
<ul>
<li>The <strong>regex</strong>, given at the <strong>end</strong> of my post :</li>
</ul>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/14501/has-a-plugin-like-sublime-plugin-brackethighlighter/12" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14501/has-a-plugin-like-sublime-plugin-brackethighlighter/12</a></p>
<p dir="auto">and the <strong><a href="http://BracketHighlighter.py" rel="nofollow ugc">BracketHighlighter.py</a></strong> Python script :</p>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/14501/has-a-plugin-like-sublime-plugin-brackethighlighter/7" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14501/has-a-plugin-like-sublime-plugin-brackethighlighter/7</a></p>
<p dir="auto">Matches and colors the <strong>totality</strong> that <strong>multi</strong>-lines area</p>
<p dir="auto">Note, that you must, <strong>first</strong>, copy/paste the regex, from your <strong>browser</strong>, in a N++ document or a <strong>new</strong> tab, then <strong>re-select</strong> that regex  and, finally, open the <strong>Find</strong> dialog, with <strong><code>Ctrl + F</code></strong></p>
<p dir="auto">=&gt; The <strong>multi</strong>-lines regex should be, <strong>automatically</strong>, filled up in the <strong><code>Find what:</code></strong> zone</p>
<p dir="auto">Now, let’s suppose you <strong>wrongly</strong> add an <strong>opening</strong> parenthesis, <strong>before</strong> the <strong><code>(123)</code></strong> string. Then, you do a second <strong>mistake</strong>, adding, this time, a <strong>closing</strong> parenthesis, <strong>after</strong> the <strong><code>(789)</code></strong> string, giving the text :</p>
<pre><code class="language-diff">{abc
((123)
^
[def(ghi)]
(jkl[mno])
(789))
     ^ 
pqr}
</code></pre>
<p dir="auto">Despite of these <strong>two consecutive</strong> mistakes, either, the <strong>regex</strong> and the <strong>script</strong> detect all the <strong>multi</strong>-lines block as <strong>correct</strong> !! Well, imagine that there quite a <strong>lot</strong> of text, between the strings <strong><code>(123)</code></strong> and <strong><code>(789)</code></strong> <strong>How</strong> to easily point out <strong>where</strong> is the problem ??!! There’s <strong>NO</strong> solution :-(((</p>
<p dir="auto"><strong>2)</strong></p>
<p dir="auto"><strong>Second</strong> problem : how to manage <strong>escaped</strong> boundaries as, for instance, <strong><code>\(</code></strong> or <strong><code>\}</code></strong>,…</p>
<p dir="auto">Compare the <strong>difference</strong> of behavior of, both, the <strong>regex</strong> and the <strong>script</strong> between these <strong>two</strong> lines :</p>
<pre><code class="language-diff">A ( simple [ example of text ]    {  to test ( MATCHING pairs )    of { braces }, [ brackets ] and  ( parentheses ) by } , ) DEFAULT

A ( simple [ example \] of text ] {  to test ( MATCHING \{ pairs ) of { braces }, [ brackets ] and  ( parentheses ) by } , ) DEFAULT
</code></pre>
<p dir="auto">So, to my mind, it would be <strong>judicious</strong> to consider all these <strong>escaped boundaries</strong> as <strong>standard</strong> characters</p>
<p dir="auto">In addition, as <strong>Scott</strong> said, I decided to <strong>avoid</strong> the <strong><code>&lt;</code></strong> and <strong><code>&gt;</code></strong> symbols, which are, generally, seen as <strong>arithmetic</strong> operators !</p>
<hr />
<p dir="auto">So, with the <strong>help</strong> of this other post :</p>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/14090/best-way-to-find-unmatched-parentheses/5" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14090/best-way-to-find-unmatched-parentheses/5</a></p>
<p dir="auto">I created a <strong>new</strong> version of the <strong><code>3</code></strong> <strong>generic recursive</strong> patterns, named <strong><code>A</code></strong>, <strong><code>B</code></strong> and <strong><code>C</code></strong>, involved in matching <strong>well</strong>-balanced [ <strong>multi</strong>-lines ] blocks of text !</p>
<p dir="auto">First, some <strong>definitions</strong> :</p>
<ul>
<li>
<p dir="auto">A <strong>boundary</strong> is one these <strong><code>6</code></strong> symbols : <strong><code> (</code></strong>  , <strong><code> )</code></strong>  , <strong><code>[</code></strong>  , <strong><code> ]</code></strong>  ,<strong><code> {</code></strong> , <strong><code>}</code></strong></p>
</li>
<li>
<p dir="auto"><strong>SB</strong> = <strong>Starting</strong> Boundary of a <strong>pair</strong>, <strong>escaped</strong> with the <strong><code>\</code></strong> symbol, to be considered as <strong>literal</strong></p>
</li>
<li>
<p dir="auto"><strong>EB</strong> = <strong>Ending</strong> boundary of a <strong>pair</strong>, <strong>escaped</strong> with the <strong><code>\</code></strong> symbol, to be considered as <strong>literal</strong></p>
</li>
<li>
<p dir="auto"><strong>AC</strong> = <strong>Allowed</strong> Character = Any <strong>single</strong> character, <strong>different</strong> from, <strong>either</strong>, the <strong>SB</strong> and the <strong>EB</strong> boundaries, possibly <strong>escaped</strong></p>
</li>
<li>
<p dir="auto"><strong>R#</strong> = <strong>Recursive</strong> call subroutine to <strong>capturing</strong> group <strong><code>#</code></strong>. Hence, the regex syntax <strong><code>(?#)</code></strong></p>
</li>
</ul>
<p dir="auto"><strong>Notes</strong>  :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(?0)</code></strong> or <strong><code>(?R)</code></strong> syntaxes are a <strong>recursive</strong> call of the <strong>overall</strong> regex</p>
</li>
<li>
<p dir="auto">An <strong>AC</strong> <strong>allowed</strong> character OR an <strong>ESCAPED</strong> boundary can be found, <strong>either</strong>, with the regexes :</p>
<ul>
<li>
<p dir="auto"><strong><code>(?x) (?: \\ [{}] | [^{}] )</code></strong> , in case of <strong>brace</strong> boundaries</p>
</li>
<li>
<p dir="auto"><strong><code>(?x) (?: \\ [][] | [^][] )</code></strong> , in case of <strong>bracket</strong> boundaries</p>
</li>
<li>
<p dir="auto"><strong><code>(?x) (?: \\ [()] | [^()] )</code></strong> , in case of <strong>parenthese</strong> boundaries</p>
</li>
<li>
<p dir="auto"><strong><code>(?x) (?: \\ [][(){}] | [^][(){}] )</code></strong>  , if <strong>brace</strong>, <strong>bracket</strong> and <strong>parenthese</strong> boundaries</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Then :</p>
<ul>
<li>
<p dir="auto">The <strong>recursive</strong> pattern <strong><code>A</code></strong> is the regex  <strong><code>SB(?:CA|R0)*EB</code></strong> , which searches the <strong>largest</strong> area, even on <strong>several</strong> lines, between a <strong>SB</strong> boundary and an <strong>EB</strong> boundary, which may contain other <strong>juxtaposed</strong> and/or <strong>nested</strong> blocks <strong>SB…EB</strong>, all <strong>correctly</strong> balanced</p>
</li>
<li>
<p dir="auto">The <strong>recursive</strong> pattern <strong><code>B</code></strong> is the regex  <strong><code>CA*(SB(?:CA|R1)*EB)CA*</code></strong> , which searches the <strong>largest</strong> area, even on <strong>several</strong> lines, between a <strong>SB</strong> boundary and an <strong>EB</strong> boundary, which may contain other <strong>juxtaposed</strong> and/or <strong>nested</strong> blocks <strong>SB…EB</strong>, all <strong>correctly</strong> balanced, possibly <strong>preceded</strong> and/or <strong>followed</strong> by any range, even <strong>null</strong>, of <strong>AC</strong> characters</p>
</li>
<li>
<p dir="auto">The <strong>recursive</strong> pattern <strong><code>C</code></strong> is the regex  <strong><code>(?:CA*(SB(?:CA|R1)*EB)CA*)+</code></strong> , which searches for any <strong>non-null</strong> amount of <strong>consecutive</strong> areas, as defined <strong>above</strong> ( <strong>matched</strong> with the regex <strong><code>(B)</code></strong> )</p>
</li>
</ul>
<hr />
<p dir="auto"><strong>Practically</strong>, here are, below, the regexes <strong><code>A</code></strong> , <strong><code>B</code></strong> and <strong><code>C</code></strong>, using the <strong>free-spacing</strong> mode, a lot of <strong>non-capturing</strong> groups and the <strong>recursive</strong> syntaxes <strong><code>(?#)</code></strong></p>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Regex A ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACE, BRACKET and PARENTHESE boundaries

( (?&lt;!\\) \{ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \} ) |
( (?&lt;!\\) \[ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \] ) |
( (?&lt;!\\) \( (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \) )

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Regex B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACE, BRACKET and PARENTHESE boundaries

(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \{ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \} ) (?: \\ [][(){}] | [^][(){}] )* |
(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \[ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \] ) (?: \\ [][(){}] | [^][(){}] )* |
(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \( (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \) ) (?: \\ [][(){}] | [^][(){}] )*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Regex C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACE, BRACKET and PARENTHESE boundaries
(?:
(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \{ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \} ) (?: \\ [][(){}] | [^][(){}] )* |
(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \[ (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \] ) (?: \\ [][(){}] | [^][(){}] )* |
(?: \\ [][(){}] | [^][(){}] )* ( (?&lt;!\\) \( (?: (?: \\ [][(){}] | [^][(){}] ) | (?1) | (?2) | (?3) )* (?&lt;!\\) \) ) (?: \\ [][(){}] | [^][(){}] )*
)+
</code></pre>
<p dir="auto">Now, if we test the regex <strong><code>A</code></strong>, against the text :</p>
<pre><code class="language-diff">A ( simple [ example of text ]    {  to test ( MATCHING pairs )    of { braces }, [ brackets ] and  ( parentheses ) by } , ) DEFAULT

A ( simple [ example \] of text ] {  to test ( MATCHING \{ pairs ) of { braces }, [ brackets ] and  ( parentheses ) by } , ) DEFAULT
</code></pre>
<p dir="auto">We get the <strong>same</strong> behavior, despite of some <strong>escaped</strong> boundaries, in the <strong>second</strong> line ;-)) Just as <strong>expected</strong> !</p>
<hr />
<p dir="auto">Now, you may prefer that these <strong><code>3</code></strong> <strong>patterns</strong>, above, would search for <strong>ONLY ONE</strong> type of <strong>boundary</strong> !</p>
<p dir="auto">So, here are, for each <strong>generic</strong> pattern, the different regexes matching, respectively, <strong>brace</strong>, <strong>bracket</strong> or <strong>parenthese</strong> boundaries :</p>
<ul>
<li>For pattern <strong><code>A</code></strong></li>
</ul>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~ Regex A ~~~~~~~~~~~~~~~~

(?x) # BRACE boundaries { and }
(?&lt;!\\) \{
(?: (?: \\ [{}] | [^{}] ) | (?0) )*
(?&lt;!\\) \}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACKET boundaries [ and ]
(?&lt;!\\) \[
(?: (?: \\ [][] | [^][] ) | (?0) )*
(?&lt;!\\) \]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # PARENTHESE boundaries ( and )
(?&lt;!\\) \(
(?: (?: \\ [()] | [^()] ) | (?0) )*
(?&lt;!\\) \)
</code></pre>
<ul>
<li>For pattern <strong><code>B</code></strong></li>
</ul>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~ Regex B ~~~~~~~~~~~~~~~~

(?x) # BRACE boundaries { and }

(?: \\ [{}] | [^{}] )*
(
(?&lt;!\\) \{
(?: (?: \\ [{}] | [^{}] ) | (?1) )*
(?&lt;!\\) \}
)
(?: \\ [{}] | [^{}] )*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACKET boundaries [ and ]

(?: \\ [][] | [^][] )*
(
(?&lt;!\\) \[
(?: (?: \\ [][] | [^][] ) | (?1) )*
(?&lt;!\\) \]
)
(?: \\ [][] | [^][] )*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # PARENTHESE boundaries ( and )

(?: \\ [()] | [^()] )*
(
(?&lt;!\\) \(
(?: (?: \\ [()] | [^()] ) | (?1) )*
(?&lt;!\\) \)
)
(?: \\ [()] | [^()] )*
</code></pre>
<ul>
<li>For pattern <strong><code>C</code></strong></li>
</ul>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~ Regex C ~~~~~~~~~~~~~~~~

(?x) # BRACE boundaries { and }
(?:
(?: \\ [{}] | [^{}] )*
(
(?&lt;!\\) \{
(?: (?: \\ [{}] | [^{}] ) | (?1) )*
(?&lt;!\\) \}
)
(?: \\ [{}] | [^{}] )*
)+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # BRACKET boundaries [ and ]
(?:
(?: \\ [][] | [^][] )*
(
(?&lt;!\\) \[
(?: (?: \\ [][] | [^][] ) | (?1) )*
(?&lt;!\\) \]
)
(?: \\ [][] | [^][] )*
)+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(?x) # PARENTHESE boundaries ( and )
(?:
(?: \\ [()] | [^()] )*
(
(?&lt;!\\) \(
(?: (?: \\ [()] | [^()] ) | (?1) )*
(?&lt;!\\) \)
)
(?: \\ [()] | [^()] )*
)+
</code></pre>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35029</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35029</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 19 Nov 2022 09:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 22 Sep 2018 13:05:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a></p>
<p dir="auto">The important-est part about either technique is that inside them this website won’t mess with the content…it will post your text verbatim.</p>
<h4>Red text:</h4>
<p dir="auto">`I am red because I am surrounded by grave accents` --&gt; <code>I am red because I am surrounded by grave accents</code><br />
See <a href="https://en.wikipedia.org/wiki/Grave_accent" rel="nofollow ugc">https://en.wikipedia.org/wiki/Grave_accent</a></p>
<h4>Black box (code window):</h4>
<pre><code>I'm text where my composer put 4 spaces in front of the "I" in "I'm"
I could be lines of code composed in N++ and then indented 4 spaces before copying!
</code></pre>
<h4>Other, related:</h4>
<p dir="auto">```z<br />
I’m a variation on the indented black box above, but without the black and without my text needing to be indented<br />
```</p>
<p dir="auto">will yield:</p>
<pre><code class="language-z">I'm a variation on the indented black box above, but without the black and without my text needing to be indented
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/35027</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35027</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 22 Sep 2018 13:05:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Sat, 22 Sep 2018 00:01:31 GMT]]></title><description><![CDATA[<p dir="auto">Like, how you typed in the “10” and the “11” up there in that little red box, also the code window.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35019</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35019</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Sat, 22 Sep 2018 00:01:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Fri, 21 Sep 2018 23:39:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a> said:</p>
<blockquote>
<p dir="auto">tell me how you do that red code box and the biger code window also</p>
</blockquote>
<p dir="auto">I don’t understand what this means.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35018</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35018</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 21 Sep 2018 23:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Fri, 21 Sep 2018 23:12:29 GMT]]></title><description><![CDATA[<p dir="auto">WoW, nice, I changed it to 11 and now I have them both working.</p>
<p dir="auto">You see, this is what seperates an expert programmer (you) with an amateur (me).</p>
<p dir="auto">You know what does what and you can find fixes to the problems fast.<br />
You are not the first progger i saw doing that, but I hope to get there 1 day.</p>
<p dir="auto">Big inspiration, and big thanks to you.</p>
<p dir="auto">I’ll cya lata, I always have ideas.</p>
<p dir="auto">(also, please tell me how you do that red code box and the biger code window also, thx)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/35016</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/35016</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Fri, 21 Sep 2018 23:12:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Thu, 20 Sep 2018 19:13:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/11655">@SalviaSage</a> said:</p>
<blockquote>
<p dir="auto">You can see this in the style configurator, it is called “bad brace colour”</p>
</blockquote>
<p dir="auto">Ah…I was not aware of this feature…too bad its default background color is not something other than white.  I have also made mine “pink” moving forward.</p>
<blockquote>
<p dir="auto">for example it says the bad bracket is at character 64, when that character is actually at character 74</p>
</blockquote>
<p dir="auto">What is the 64 and 74 character things you are talking about?  I see no indication other than a “pink” bracket…  I think maybe what you are saying is that it is turning the bracket at <em>column</em> 64 pink when it should do the one at <em>column</em> 74…?  Is that right?  Well, I can’t see exactly what you mean, but I’m thinking that you as the human are judging right-from-wrong in a context where there is little chance that Notepad++ itself can do the same.  Sure, it can tell you you don’t have all the brackets correctly matched, but exactly which ones are supposed to match…it has no real clue.  And that’s probably where the whole thing falls apart (and, if you’ll notice, is subtly where I’ve been leading you from the start of this thread).</p>
<p dir="auto">Which bracket (actually “parenthesis”) should be colored pink below, and why?  Which one should Notepad++ choose to color pink?</p>
<pre><code>(((    :^)    )))
</code></pre>
<p dir="auto">BTW, the “bracket highlighter” Pythonscript also has to make a right–or wrong–choice here…note that we aren’t doing a whole-document tokenizing-check…just a simple “do I have an opening-bracket to my left and a closing-bracket to my right” check…</p>
<blockquote>
<p dir="auto">it bugs the EOL whitespace feature while the inside bracket highlighting still works.</p>
</blockquote>
<p dir="auto">So if you run the EOL-whitespace thing first, and then the bracket-highlighter, you’re going to have the effect you say you see, for the simple reason that they are both using the same indicator number, because they share a very similar line of source code:</p>
<pre><code>XXXX__dict['indic_to_use'] = 10  # pick a free indicator number
</code></pre>
<p dir="auto">After you use <code>10</code> in the execution of one script, it is no longer a “free indicator number”.  If you change one of the <code>10</code>s to something else, e.g. <code>11</code>, the functionality of the two scripts should peacefully coexist when both are run.</p>
<blockquote>
<p dir="auto">I think the codes can be merged though</p>
</blockquote>
<p dir="auto">Yes, nothing preventing that, and not too hard…I leave that as an exercise for the reader.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34974</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34974</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Thu, 20 Sep 2018 19:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Thu, 20 Sep 2018 11:15:04 GMT]]></title><description><![CDATA[<p dir="auto">I would appreciate it though, if the code for EOL whitespace could be modified in some way to also allow for this feature (without breaking it).</p>
<p dir="auto">Also,  that inside bracket highlighter is a cool feature, but again it does not work together with the EOL whitespace code. it bugs the EOL whitespace feature while the inside bracket highlighting still works.</p>
<p dir="auto">I think the codes can be merged though,</p>
<p dir="auto">so, we could have the bad bracket highlighter, and the eol whitespace highlighter and the inside parenthesis highlighter all working in unison, I am trying to kinda merge the code but I don’t know if I will ever be able to do that without your help.</p>
<p dir="auto">Thanks for all your work and see you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34966</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34966</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Thu, 20 Sep 2018 11:15:04 GMT</pubDate></item><item><title><![CDATA[Reply to Bad Bracket Highlighter on Thu, 20 Sep 2018 11:09:36 GMT]]></title><description><![CDATA[<p dir="auto">Dear Scott Sumner;</p>
<p dir="auto">What I mean is, aside from notepad++ highlighting the brackets with their matching brackets, it can also detect if a bracket does not have a matching pair and then color that bracket differently. You can see this in the style configurator, it is called “bad brace colour”</p>
<p dir="auto">You might have missed this though, because by default the background for this highlighter is white, I changed it to pink though to alert me, but it only does this highlighting when your cursor is on that bracket.</p>
<p dir="auto">So, I was thinking we could highlight it always, and the brackets check does not do that, but it does inform you if there is a bad bracket, but it is not perfect. For example, it can not tell apart the less than or greater than sign “&gt;” because the code for that is not in there.</p>
<p dir="auto">Also,  there is a bug at the location of the character that it informs you, for example it says the bad bracket is at character 64, when that character is actually at character 74 etc.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34965</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34965</guid><dc:creator><![CDATA[SalviaSage]]></dc:creator><pubDate>Thu, 20 Sep 2018 11:09:36 GMT</pubDate></item></channel></rss>