<?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[Using Mark (Markers) and Styles]]></title><description><![CDATA[<p dir="auto">Is there a simple How-To write-up for using Markers for the following:</p>
<p dir="auto">Search/Mark for different words and<br />
Mark the Results in different colors and<br />
(optionally) Color the Bookmark Bubbles in the Margin Area in the same respective colors?</p>
<p dir="auto">I have gone through this forum, and read various posts, but the basic question is not “answered clearly” (there are plenty of justifying tangential discussions about complexities and what things have to be aligned together etc.)</p>
<p dir="auto">I upgraded to the latest version today, and I was hoping to see relevant button/drops downs in the Search/Mark panel (that comes up when you do Control-F). But I do not see any when I select the Mark Tab.</p>
<p dir="auto">I was hoping to see a drop down for<br />
what Style to use? (one of Styles 1, 2…5)</p>
<p dir="auto">Side Note:<br />
I know and did configure colors for each style using<br />
Settings-&gt;Style Configurator.</p>
<p dir="auto">On the Search-&gt;Mark All-&gt; …<br />
I do see each style showing different colors and<br />
so I know that is working correctly.</p>
<p dir="auto">Anyway Results are Marked with the Same “Red” color.</p>
<p dir="auto">This is such a powerful feature and I started needing such features as my programming context has exploded in complexity.</p>
<p dir="auto">Just in case you are wondering, I have been using Notepad++ for 20+ years. But this is the first time I am exploring the Styles… I assumed it was something to do with UI appearance, and not a User productivity function.</p>
<p dir="auto">Appreciate your help.</p>
<p dir="auto">regards Sri.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21275/using-mark-markers-and-styles</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 13:18:48 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21275.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Jun 2021 18:04:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Wed, 09 Aug 2023 14:42:52 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/88476">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">the conclusion is that this feature is broken (if I can break it so easily).</p>
</blockquote>
<blockquote>
<p dir="auto">it is easy to get the UI out of sync just using the built-in features (no scripting).</p>
</blockquote>
<p dir="auto">Ah, OK – I thought you meant something with the script.<br />
Yes, the feature is very broken, for many reasons.<br />
This has long been known.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88477</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88477</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 09 Aug 2023 14:42:52 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Wed, 09 Aug 2023 14:38:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> , the bug in your message above:</p>
<blockquote>
<p dir="auto">As an example, it is easy to get the UI out of sync just using the built-in features (no scripting).</p>
<p dir="auto">Example:</p>
<p dir="auto">Start with text:</p>
<pre><code>one
two
three
four
five
six
seven
eight
nine
ten
</code></pre>
<p dir="auto">Make a selection of some lines:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099400537-7d1b8e7d-3b23-4cf9-a08a-e36bf12f21cb-image.png" alt="7d1b8e7d-3b23-4cf9-a08a-e36bf12f21cb-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Right-click that selection and pick <em>Hide Lines</em> to obtain:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099426063-b1f41544-63c7-45aa-9258-5087ba51078e-image.png" alt="b1f41544-63c7-45aa-9258-5087ba51078e-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Make another selection, like so:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099461475-b30efab0-2fb3-4a13-93ff-95d52c414754-image.png" alt="b30efab0-2fb3-4a13-93ff-95d52c414754-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Right-click that selection and pick <em>Hide Lines</em> to obtain:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099499383-62fa30c0-990a-4d46-87bc-2cd9f3a75866-image.png" alt="62fa30c0-990a-4d46-87bc-2cd9f3a75866-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Left-click the green arrow in the margin on line 2.<br />
This seems like it should expand the text back to a no-lines-hidden state, or perhaps the previous state where lines 5, 6 and 7 were the only hidden ones.<br />
But what we get is:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099615908-d98da195-f284-46a5-ae01-8a42b60dd8bf-image.png" alt="d98da195-f284-46a5-ae01-8a42b60dd8bf-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">So we do get the state where lines 5, 6 and 7 are the hidden ones.<br />
But…there’s no way to ever unhide them (well, switching tabs and back does it!)<br />
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.</p>
<p dir="auto">So the conclusion is that this feature is broken (if I can break it so easily).</p>
</blockquote>
]]></description><link>https://community.notepad-plus-plus.org/post/88476</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88476</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 09 Aug 2023 14:38:56 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Wed, 09 Aug 2023 11:03:05 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/88463">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">Maybe you already know, as &gt; 2 years passed, but if not: I could not reproduce that bug, so I guess it’s been fixed.</p>
</blockquote>
<p dir="auto">Not sure what you mean has been fixed…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88469</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88469</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 09 Aug 2023 11:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Wed, 09 Aug 2023 02:17:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/66832">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">But…there’s no way to ever unhide them (well, switching tabs and back does it!)<br />
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.<br />
So the conclusion is that this feature is broken (if I can break it so easily).</p>
</blockquote>
<p dir="auto">Maybe you already know, as &gt; 2 years passed, but if not: I could not reproduce that bug, so I guess it’s been fixed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88463</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88463</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 09 Aug 2023 02:17:31 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Tue, 08 Jun 2021 12:20:36 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 in <a href="/post/66853">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">Of course, as soon as you switch to another tab and switch back to your file, all the hidden lines appear again !</p>
</blockquote>
<p dir="auto">Yes, this limitation was mentioned earlier.<br />
It can be avoided with more code, but as this was just intended to be a demo to show <a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> the possibilities of scripting, I didn’t do it.</p>
<p dir="auto">Regarding other changes:  Yes, with scripting the possibilities are limitless!  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66855</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66855</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 08 Jun 2021 12:20:36 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Tue, 08 Jun 2021 12:13:36 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: sridhar-raghavan">@<bdi>sridhar-raghavan</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Just tried your <strong>second</strong> version, using <strong><code>1</code></strong> line <strong>before</strong> hit and  <strong><code>1</code></strong> line <strong>after</strong> it. <strong>Interesting</strong>, indeed, with the “<em>Hide Lines</em>” mechanism. Just enable the <strong><code>line number</code></strong> margin !</p>
<p dir="auto">Of course, as soon as you switch to <strong>another</strong> tab and switch <strong>back</strong> to your file, all the <strong>hidden</strong> lines appear again !</p>
<hr />
<p dir="auto">Now, I thought about <strong>two</strong> improvements. But, <strong>Alan</strong>, they are just <strong>suggestions</strong> and <em>ONLY IF</em> <a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: sridhar-raghavan">@<bdi>sridhar-raghavan</bdi></a> would need it, too !</p>
<ul>
<li>
<p dir="auto">By default, the <strong><code>Python</code></strong> search is <strong>sensible</strong> to case et does <strong>not</strong> care about the <strong>whole word</strong> notion. So, could it possible to search for any <strong>case</strong> and to search for <strong>whole words</strong> only ?</p>
</li>
<li>
<p dir="auto">I thought that you could also enter <strong>all</strong> the parameters in an <strong>unique</strong> prompt window !</p>
</li>
<li>
<p dir="auto">With <strong>double quotes</strong> to surround expressions containing <strong>space</strong> characters</p>
</li>
<li>
<p dir="auto">With inside a couple of <strong>parentheses</strong> :</p>
<ul>
<li>
<p dir="auto"><strong><code>w</code></strong> would mean <strong><code>Word only</code></strong></p>
</li>
<li>
<p dir="auto"><strong><code>i</code></strong> would mean <strong><code>Ignore case</code></strong></p>
</li>
<li>
<p dir="auto"><strong><code>r</code></strong> would mean <strong><code>Remove all styles</code></strong></p>
</li>
<li>
<p dir="auto"><strong><code>#</code></strong> would mean <strong>Style <code>#</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">When <strong>absent</strong>, each <strong>parameter</strong> would be supposed to be the <strong>default</strong> present <strong><code>Python</code></strong> script behavior !</p>
<hr />
<p dir="auto">So, for instance, the text <strong><code>License (rw5) software (i3) "GNU GENERAL PUBLIC LICENSE" (iw43)</code></strong> would mean :</p>
<ul>
<li>
<p dir="auto">Remove <strong>all</strong> styles first</p>
</li>
<li>
<p dir="auto">Highlight any <strong>word</strong> <strong><code>License</code></strong>, with this <strong>exact</strong> case, in <strong>style</strong> <strong><code>5</code></strong></p>
</li>
<li>
<p dir="auto">Highlight any <strong>string</strong> <strong><code>software</code></strong>, <strong>whatever</strong> its case, in <strong>style</strong> <strong><code>3</code></strong></p>
</li>
<li>
<p dir="auto">Highlight any <strong>exact</strong> expression <strong><code>GNU GENERAL PUBLIC LICENSE</code></strong>, <strong>whatever</strong> its case, in <strong>style</strong> <strong><code>4</code></strong> <em>AND</em> in style <strong><code>3</code></strong>, too</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66853</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66853</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 08 Jun 2021 12:13:36 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 21:12:54 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Alan for that tip. I would have never found it by trying things (hoping for the hidden commands!).  That gets me going now.</p>
<p dir="auto">Thanks for the quick work on the code for the “windowed” display. Great.</p>
<p dir="auto">I think your code with additional check boxes and drop downs is rapidly getting to becoming a good plugin!!</p>
<p dir="auto">It was a general experiential statement on my part that APIs and Scripting languages are after-thought add-ons,  done with less rigor. But not always the case, including the example you cite.</p>
<p dir="auto">br Sri.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66833</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66833</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Mon, 07 Jun 2021 21:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 21:08:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/66831">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">I think in the core code the hidden line feature is just not that good</p>
</blockquote>
<p dir="auto">As an example, it is easy to get the UI out of sync just using the built-in features (no scripting).</p>
<p dir="auto">Example:</p>
<p dir="auto">Start with text:</p>
<pre><code>one
two
three
four
five
six
seven
eight
nine
ten
</code></pre>
<p dir="auto">Make a selection of some lines:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099400537-7d1b8e7d-3b23-4cf9-a08a-e36bf12f21cb-image.png" alt="7d1b8e7d-3b23-4cf9-a08a-e36bf12f21cb-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Right-click that selection and pick <em>Hide Lines</em> to obtain:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099426063-b1f41544-63c7-45aa-9258-5087ba51078e-image.png" alt="b1f41544-63c7-45aa-9258-5087ba51078e-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Make another selection, like so:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099461475-b30efab0-2fb3-4a13-93ff-95d52c414754-image.png" alt="b30efab0-2fb3-4a13-93ff-95d52c414754-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Right-click that selection and pick <em>Hide Lines</em> to obtain:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099499383-62fa30c0-990a-4d46-87bc-2cd9f3a75866-image.png" alt="62fa30c0-990a-4d46-87bc-2cd9f3a75866-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Left-click the green arrow in the margin on line 2.<br />
This seems like it should expand the text back to a no-lines-hidden state, or perhaps the previous state where lines 5, 6 and 7 were the only hidden ones.<br />
But what we get is:</p>
<p dir="auto"><img src="/assets/uploads/files/1623099615908-d98da195-f284-46a5-ae01-8a42b60dd8bf-image.png" alt="d98da195-f284-46a5-ae01-8a42b60dd8bf-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">So we do get the state where lines 5, 6 and 7 are the hidden ones.<br />
But…there’s no way to ever unhide them (well, switching tabs and back does it!)<br />
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.</p>
<p dir="auto">So the conclusion is that this feature is broken (if I can break it so easily).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66832</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66832</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 21:08:51 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 20:48:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66828">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">unless Scripting is done carefully, one may easily break the consistencies ensured rigorously in the core code.</p>
</blockquote>
<p dir="auto">Well, to be honest, I think in the core code the hidden line feature is just not that good.  So much for the need for “consistencies ensured rigorously”.  :-)</p>
<p dir="auto">And, strangely, in all of the forum postings here, hiding and showing lines again is very rarely discussed.  Probably, because in Notepad++ the feature is very basic as I described earlier.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66831</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66831</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 20:48:22 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 20:45:03 GMT]]></title><description><![CDATA[<p dir="auto">I thought of another bit of a downside to hiding lines:<br />
If you switch away from the tab in which you’ve hidden lines (via script), when you return to that tab, all the lines become visible again.</p>
<p dir="auto">That makes for an easy way to make lines visible again in a simple demo, but in a real application the code would have to handle that situation reasonably, which makes the code much more complicated.</p>
<p dir="auto">Here’s a simple demo for only showing lines with hits and two lines before and three lines after:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-
from __future__ import print_function

from Npp import editor, notepad

# Notepad++'s style numbers:
#  25 = Style #1
#  24 = Style #2
#  23 = Style #3
#  22 = Style #4
#  21 = Style #5

class T_21275a(object):

    def __init__(self):
        lines_above = 2
        lines_below = 3
        search_input = notepad.prompt('Enter search string:', '', '')
        if search_input == None or len(search_input) == 0: return
        matches = []
        editor.search(search_input, lambda m: matches.append(m.span(0)))
        if len(matches) &gt; 0:
            color_input = notepad.prompt('Enter style color number (1-5):', '', '')
            try:
                color_input = int(color_input)
            except ValueError:
                return
            if 1 &lt;= color_input &lt;= 5:
                color_input -= 1
                editor.hideLines(1, editor.getLineCount() - 1)
                for (match_start_pos, match_end_pos) in matches:
                    editor.setIndicatorCurrent(25 - color_input)
                    editor.indicatorFillRange(match_start_pos, match_end_pos - match_start_pos)
                    match_start_line = editor.lineFromPosition(match_start_pos)
                    match_end_line = editor.lineFromPosition(match_end_pos)
                    show_start_line = match_start_line - lines_above
                    if show_start_line &lt; 1: show_start_line = 1
                    show_end_line = match_end_line + lines_below
                    if show_end_line &gt; editor.getLineCount() - 1: show_end_line = editor.getLineCount() - 1
                    editor.showLines(show_start_line, show_end_line)

if __name__ == '__main__': T_21275a()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/66830</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66830</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 20:45:03 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 20:34:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66828">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">How do I Edit that Script code?  Do not see any obvious menus for it.</p>
</blockquote>
<p dir="auto">Ah, yes, that’s a bit of a “trick” for the first-timers.</p>
<p dir="auto">To run the script you select it via the menus (as I’m sure you’ve found).<br />
To edit it (after the first time you’ve closed it, of course, otherwise you don’t have to find/open it to edit it, it’s just there), <em><strong>you hold down Ctrl while you pick its name from the menus</strong></em>.  This opens the file for editing rather than running the script.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66829</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66829</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 20:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 20:24:22 GMT]]></title><description><![CDATA[<p dir="auto">Alan</p>
<p dir="auto">I agree it is better to use Scripting to weave together simple building block functions into more powerful personalized ones. But, as you pointed out, unless Scripting is done carefully, one may easily break the consistencies ensured rigorously in the core code.</p>
<p dir="auto">Just a quick/simple question.<br />
I installed your code and it functions fine as intended.</p>
<p dir="auto">How do I Edit that Script code?  Do not see any obvious menus for it.</p>
<p dir="auto">More generally, what is the basic edit/test iterate cycle?<br />
So I can experiment with your code.</p>
<p dir="auto">br Sri.<br />
P.S.  I am holding off on systematic reading the full Scripting Tutorial as yet.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66828</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66828</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Mon, 07 Jun 2021 20:24:22 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 17:45:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66814">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">Is there a function to hide bookmarked lines?  (and of course unhide if it can be defined)</p>
</blockquote>
<blockquote>
<p dir="auto">Show Only Marked Areas. (and hide all Un-Marked Areas). Specific to a color.</p>
</blockquote>
<blockquote>
<p dir="auto">And the counterpart Unhide Marked Areas of Specific Color.</p>
</blockquote>
<p dir="auto">Notepad++ has a “hide / unhide lines” feature, see <em>View</em> menu &gt; <em>Hide Lines</em>, or maybe more handy, on the right-click context menu (bottom entry called <em>Hide Lines</em>).<br />
But it is purely a user selection thing – there is no way within Notepad++ to hide lines based upon a result of a search/mark operation.<br />
Scripting can do it, but there’s a limitation:  It would get out of sync with user interface control of hidden lines.<br />
If that’s not a big deal to you (you would only hide/unhide lines via scripted commands), then that’s doable.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66817</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66817</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 17:45:24 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 17:39:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66814">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">Note: Current Mark Panel has a “Copy Marked Text” button, but it only copies the “marked  text” and not the lines.   So you get a redundant list of the same text many times (except one is using regex).</p>
</blockquote>
<p dir="auto">Yes, it often goes unstated here when people talk about <em>Copy Marked Text</em>, but it really is only useful when dealing with text that was marked by a regular expression search.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66816</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66816</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 17:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 17:38:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66814">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">I am sure there would be additional operations may be invoked on “Bookmarked” lines, that can be very useful.<br />
Side Note. Like Copy Bookmarked Lines, Remove Bookmarked Lines, Remove Un Marked Lines.</p>
</blockquote>
<p dir="auto">You mean these kinds of commands? (note red dot is right-click point):</p>
<p dir="auto"><img src="/assets/uploads/files/1623087469946-2a2c2d16-a04d-4437-8f7d-a5e76a39d7c0-image.png" alt="2a2c2d16-a04d-4437-8f7d-a5e76a39d7c0-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/66815</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66815</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 17:38:08 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 17:35:06 GMT]]></title><description><![CDATA[<p dir="auto">Alan</p>
<p dir="auto">You are absolutely right.   The ability to mark different colors and jump up/down gives all the functionality I needed. Bookmark is not needed for the stated purpose.</p>
<p dir="auto">I am happy to see that this exactly addresses the “canonical” problem I was referring to.   I am sure there would be additional operations may be invoked on “Bookmarked” lines, that can be very useful.</p>
<p dir="auto"><em><strong>Side Note. Like Copy Bookmarked Lines, Remove Bookmarked Lines, Remove Un Marked Lines.</strong></em></p>
<p dir="auto">br Sri.</p>
<p dir="auto"><strong>More…</strong></p>
<p dir="auto">Here a few additional things I would like to do in the work activity context …</p>
<p dir="auto"><strong>a) Show Only Marked Areas.  (and hide all Un-Marked Areas). Specific to a color.</strong></p>
<p dir="auto">If a line has a marked text, then<br />
N lines above and<br />
M lines below will be<br />
considered as “Marked Areas”.<br />
(this will give a window surrounding the marked text).</p>
<p dir="auto">And the counterpart Unhide Marked Areas of Specific Color.</p>
<p dir="auto"><em><strong>Note: Current Mark Panel has a “Copy Marked Text” button, but it only copies the “marked  text” and not the lines.   So you get a redundant list of the same text many times (except one is using regex).</strong></em></p>
<p dir="auto"><strong>b) Bookmarks can be inversed. Good to know and this is nice.</strong></p>
<p dir="auto">Is there a function to hide bookmarked lines?  (and of course unhide if it can be defined)</p>
<p dir="auto"><strong>I owe a deep and sincere thanks to you. This thread of discussion has been personally extremely valuable for understanding these features [which I had not been using], the main drive for this thread.  I hope this also benefits others. Furthermore, it triggers a revisit of these related functions by developers,  at some point,  for expressive consistencies and completeness.</strong></p>
<p dir="auto">I <em><strong>will certainly write a short note on things learned here and post it. A similar note by you might be far better given your solid overall understanding of individual functions and how they may be combined together.</strong></em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/66814</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66814</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Mon, 07 Jun 2021 17:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 11:49:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a></p>
<p dir="auto">I’m still unsure why you even need the bookmarks.</p>
<p dir="auto">Say you use the script to mark multiple pieces of text with multiple different colors.</p>
<p dir="auto">Then you can use the <em>Jump Down</em> (or <em>Jump Up</em>) commands on the <em>Search</em> menu to navigate to any color you’d like:</p>
<p dir="auto"><img src="/assets/uploads/files/1623066380901-3be7fc72-d780-4b90-a365-bf019975492f-image.png" alt="3be7fc72-d780-4b90-a365-bf019975492f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Either one of these submenus contains the colors possible:</p>
<p dir="auto"><img src="/assets/uploads/files/1623066440934-08442ca6-3741-4fb2-b649-02b2df488573-image.png" alt="08442ca6-3741-4fb2-b649-02b2df488573-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">So for example, say you mark some text (with the script) in the 5th style, i.e. default of green color.  Then you may find occurrences of your marked text from you current position to the end of your file by repeatedly pressing Ctrl+5.</p>
<p dir="auto">No need for bookmarks of any type, or am I still misunderstanding your desires?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66795</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66795</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 07 Jun 2021 11:49:22 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 04:36:39 GMT]]></title><description><![CDATA[<p dir="auto">Alan</p>
<p dir="auto">Just ran your code.<br />
It took only a few seconds to get going with it.</p>
<p dir="auto">Plugins-&gt;Python Scripts -&gt; New -&gt; Gave a Name to the file,<br />
copied and pasted your code,<br />
saved.</p>
<p dir="auto">The script showed up in Plugins-&gt;Python Scripts-&gt; Scripts</p>
<p dir="auto">Works nicely creating different colored marked items.<br />
Thanks for the Nice Job creating this basic idiom for building further.</p>
<p dir="auto">br Sri.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66781</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66781</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Mon, 07 Jun 2021 04:36:39 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Mon, 07 Jun 2021 04:23:21 GMT]]></title><description><![CDATA[<p dir="auto">Alan</p>
<p dir="auto">Thanks for both your notes and the nice code.<br />
I will install, test/use it -  could not get to it yet.<br />
Thanks also for the pointer to Peter Jones tutorial.<br />
I am planning to venture into this - as I think it will come handy for other situations.</p>
<p dir="auto">Sorry if some of the things are not clear.<br />
I was going to say something more about the alternate methods for doing searching, marking, bookmarking and previous/next navigation.  But let me play with all the approaches, including your code, to get a better grip of the pros/cons.</p>
<p dir="auto">My main goal is to be able to pursue more than one thread of code analysis &amp; tracking through a code File.</p>
<p dir="auto">Incidentally it dawned on me, that the ability to bookmark manually in different colors and doing prev/next through different colored set is the real underlying canonical problem.  That capability will be more general and powerful - and will serve better during code analysis. I will be able to bookmark as needed - and this may not correlate much with search terms.</p>
<p dir="auto">Your last line about “bookmark symbols” caught my eye as well. Were you highlighting that bookmarks could vary in colors as well as shapes?   Clearly the ability to do next/prev on a selected set is quite critical.</p>
<p dir="auto">br Sri.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66780</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66780</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Mon, 07 Jun 2021 04:23:21 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Sun, 06 Jun 2021 12:54:34 GMT]]></title><description><![CDATA[<p dir="auto">And, while it is possible to do some manipulations with the bookmark symbol, if what you want to do extends beyond something visual, there’s going to be deficiencies.</p>
<p dir="auto">But, still, I am unclear on what your intentions are for bookmarks that reflect a color.</p>
<p dir="auto">But, for the sake of fun, here’s an example of making the bookmark look like Style #1:</p>
<p dir="auto"><img src="/assets/uploads/files/1622983989681-be3c3693-27d1-4268-8148-664537bf931e-image.png" alt="be3c3693-27d1-4268-8148-664537bf931e-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I should mention that the <code>24</code> is Notepad++'s internal number for a bookmark.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66758</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66758</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 06 Jun 2021 12:54:34 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Sun, 06 Jun 2021 12:05:53 GMT]]></title><description><![CDATA[<p dir="auto">So here’s a very simple demo PythonScript that prompts you for a string to search for, then prompts you for a color/style, then does the desired hit styling:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-
from __future__ import print_function

from Npp import editor, notepad

# Notepad++'s style numbers:
#  25 = Style #1
#  24 = Style #2
#  23 = Style #3
#  22 = Style #4
#  21 = Style #5

class T_21275(object):

    def __init__(self):
        search_input = notepad.prompt('Enter search string:', '', '')
        if search_input == None or len(search_input) == 0: return
        matches = []
        editor.search(search_input, lambda m: matches.append(m.span(0)))
        if len(matches) &gt; 0:
            color_input = notepad.prompt('Enter style color number (1-5):', '', '')
            try:
                color_input = int(color_input)
            except ValueError:
                return
            if 1 &lt;= color_input &lt;= 5:
                color_input -= 1
                for (match_start_pos, match_end_pos) in matches:
                    editor.setIndicatorCurrent(25 - color_input)
                    editor.indicatorFillRange(match_start_pos, match_end_pos - match_start_pos)

if __name__ == '__main__': T_21275()
</code></pre>
<p dir="auto">There’s a nice PeterJones tutorial for obtaining the PythonScript plugin and getting your first script going, found <a href="https://community.notepad-plus-plus.org/post/62027">HERE</a>, if you need that.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66757</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66757</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 06 Jun 2021 12:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Sun, 06 Jun 2021 10:47:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sridhar-raghavan" aria-label="Profile: Sridhar-Raghavan">@<bdi>Sridhar-Raghavan</bdi></a> said in <a href="/post/66753">Using Mark (Markers) and Styles</a>:</p>
<blockquote>
<p dir="auto">if you do not know if/where the token is present you have to do that find first.</p>
</blockquote>
<p dir="auto">True.</p>
<blockquote>
<p dir="auto">But how does one express the bookmark option?</p>
</blockquote>
<p dir="auto">Bookmarking is not available using <em>Style token</em> styling; only via the <em>Mark</em> functionality.</p>
<blockquote>
<p dir="auto">For me, this is better than the other two options…</p>
<p dir="auto">The other method Search -&gt;Mark -&gt; is not clear about what is being searched for.</p>
<p dir="auto">The Search Panel (Control-F) is not clear about what Style is being used.</p>
</blockquote>
<p dir="auto">I’m not sure I understand this part.<br />
“for me this is better” – what is better?</p>
<p dir="auto"><em>Search</em> &gt; <em>Mark</em> <em><strong>IS</strong></em> very clear about what is being searched for … it is in the <em>Find what</em> box</p>
<p dir="auto">There is no styling with Ctrl+f searching.  With the Ctrl+m (<em>Mark</em>) searching, there’s only one style used, the default red styling.</p>
<blockquote>
<p dir="auto">Regarding the demo, please consider it as a lesson on how one might do this via Scripting. I did read about scripting and since it is Pythonic, it feels like I will be in my comfort zone. (but Objects, Methods, Sequencing and other things will be the key).</p>
</blockquote>
<p dir="auto">Sure, I’ll continue with the demo – check back in a bit.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66755</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66755</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 06 Jun 2021 10:47:53 GMT</pubDate></item><item><title><![CDATA[Reply to Using Mark (Markers) and Styles on Sat, 05 Jun 2021 22:20:19 GMT]]></title><description><![CDATA[<p dir="auto">Alan</p>
<p dir="auto">Sorry for the delay. I was off line.</p>
<p dir="auto">Interesting and you are right.<br />
Thanks for pointing out that the Style Token -&gt; … is available on the Right Click Menu.<br />
That is clearer for use, as the selected/Highlighted Token is what is being searched with the selected Style.<br />
But if you do not know if/where the token is present you have to do that find first.<br />
Yes the minimum functionality is present through this.<br />
I can also leverage this for tracing more than one thread of token(s) through my code.</p>
<p dir="auto">But how does one express the bookmark option?<br />
The found lines are not bookmarked as of now.</p>
<p dir="auto">For me,  this is better than the other two options…</p>
<ol>
<li>The other method Search -&gt;Mark -&gt;  is not clear about what is being searched for.</li>
<li>The Search Panel (Control-F)  is not clear about what Style is being used.</li>
</ol>
<p dir="auto">This also brings to the fore, the need for the colored bookmarks and… for doing next/prev on the selected color.</p>
<p dir="auto">Regarding the demo, please consider it as a lesson on how one might do this via Scripting.  I did read about scripting and since it is Pythonic, it feels like I will be in my comfort zone. (but Objects, Methods, Sequencing and other things will be the key).</p>
<p dir="auto">br Sri.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66753</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66753</guid><dc:creator><![CDATA[Sridhar Raghavan]]></dc:creator><pubDate>Sat, 05 Jun 2021 22:20:19 GMT</pubDate></item></channel></rss>