<?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[How to highlight lines with color one by one?]]></title><description><![CDATA[<p dir="auto">like zebra? <img src="/assets/uploads/files/1640600043542-zebra.png" alt="zebra.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22309/how-to-highlight-lines-with-color-one-by-one</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 19:04:24 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22309.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Dec 2021 10:15:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Thu, 08 Feb 2024 00:17:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> said in <a href="/post/92759">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">…loop through character by character checking SCI_POINTYFROMPOSITION  to determine where the wrapping happens</p>
</blockquote>
<p dir="auto">The original script fires its logic every time the UI is updated (maybe that could be changed to every time the data is modified instead).<br />
When I wrote the original script, I had “performance” concerns for the script, with moderately-sized files and larger.<br />
I have even more concerns about that if the script is changed for the newly requested feature for it (which would incorporate the “looping” <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> mentioned).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92760</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92760</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 08 Feb 2024 00:17:58 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 21:35:03 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/92725">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">While <em>line</em> information (both document and display) is easy to obtain, position data for wrapped lines (e.g. position of where each wrapping occurs) doesn’t seem to be available.<br />
[…]<br />
I think it would be a bigger effort than I consider worth it to put in.  Unless…someone sees it differently and there is a straightforward way to do it.</p>
</blockquote>
<p dir="auto">I had to deal with a somewhat similar problem (getting the “real” pixel width of text that might be wrapped) <a href="https://github.com/Coises/ColumnsPlusPlus/blob/4164a077b3511237234ce005402d796dec66f900/src/ColumnsPlusPlus.h#L482" rel="nofollow ugc">here</a>. It’s possible, but messy — <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_WRAPCOUNT" rel="nofollow ugc">SCI_WRAPCOUNT</a> will tell you if a line is wrapped, but then you have to loop through character by character checking <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_POINTYFROMPOSITION" rel="nofollow ugc">SCI_POINTYFROMPOSITION</a> to determine where the wrapping happens.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92759</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92759</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Wed, 07 Feb 2024 21:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 19:17:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a></p>
<p dir="auto">Not sure what good Split Lines would do here, at all!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92758</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92758</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 07 Feb 2024 19:17:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 13:19:42 GMT]]></title><description><![CDATA[<p dir="auto">Something with <strong>Split Lines</strong> perhaps…?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92726</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92726</guid><dc:creator><![CDATA[Andi Kiissel]]></dc:creator><pubDate>Wed, 07 Feb 2024 13:19:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 12:04:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/t-w" aria-label="Profile: T-W">@<bdi>T-W</bdi></a></p>
<p dir="auto">I’m going to waffle back to my original comment in that the new desire isn’t reasonably possible.  In the original script, <em>position</em> is used heavily to decide where to put the “coloring”.  While <em>line</em> information (both document and display) is easy to obtain, position data for wrapped lines (e.g. position of where each wrapping occurs) doesn’t seem to be available.</p>
<p dir="auto">Now I’m not going to say it is impossible, because software is amazing and can do extraordinary things, but I think it would be a bigger effort than I consider worth it to put in.  Unless…someone sees it differently and there is a straightforward way to do it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92725</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92725</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 07 Feb 2024 12:04:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 03:19:08 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/92717">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">I took a closer look at the script, and I think I’ve changed my mind about it not being possible. Let me see if I can put together a changed script that will do as you want…</p>
</blockquote>
<p dir="auto">thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92718</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92718</guid><dc:creator><![CDATA[T W]]></dc:creator><pubDate>Wed, 07 Feb 2024 03:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 07 Feb 2024 01:26:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/t-w" aria-label="Profile: T-W">@<bdi>T-W</bdi></a></p>
<p dir="auto">I took a closer look at the script, and I think I’ve changed my mind about it not being possible.  Let me see if I can put together a changed script that will do as you want…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92717</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92717</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 07 Feb 2024 01:26:10 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Tue, 06 Feb 2024 14:58:32 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/92704">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/t-w" aria-label="Profile: T-W">@<bdi>T-W</bdi></a> said:</p>
<blockquote>
<p dir="auto">If selected Word Wrap, the display as below,if possible,please modify the code to highlight lines with color one by one.</p>
</blockquote>
<p dir="auto">I don’t think what you’re asking for is possible.<br />
But…when you really sit back and consider it, isn’t it better the way your example shows it anyway?<br />
A line that is visually wrapped so it appears on 2+ lines is still only one line…</p>
</blockquote>
<p dir="auto">The interlaced brightening function increases the Angle of view of the eye by 3 times, reducing the load of the eye and improving the reading speed. I think it’s still necessary to focus on the visual line rather than the document line. I would like to try to change it based on yours. Can you give me some clues, such as the keywords you use, grammar and other background knowledge?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92710</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92710</guid><dc:creator><![CDATA[T W]]></dc:creator><pubDate>Tue, 06 Feb 2024 14:58:32 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Tue, 06 Feb 2024 11:49:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/t-w" aria-label="Profile: T-W">@<bdi>T-W</bdi></a> said:</p>
<blockquote>
<p dir="auto">If selected Word Wrap, the display as below,if possible,please modify the code to highlight lines with color one by one.</p>
</blockquote>
<p dir="auto">I don’t think what you’re asking for is possible.<br />
But…when you really sit back and consider it, isn’t it better the way your example shows it anyway?<br />
A line that is visually wrapped so it appears on 2+ lines is still only one line…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92704</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92704</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 06 Feb 2024 11:49:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Tue, 06 Feb 2024 04:58:45 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><br />
If selected Word Wrap, the display as below,if possible,please modify the code  to highlight lines with color one by one.<br />
Best Regards</p>
<p dir="auto"><img src="/assets/uploads/files/1707195299562-1ec3b1c1-a8d4-4f12-b7a6-407b96d3cf38-image.png" alt="1ec3b1c1-a8d4-4f12-b7a6-407b96d3cf38-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/92699</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92699</guid><dc:creator><![CDATA[T W]]></dc:creator><pubDate>Tue, 06 Feb 2024 04:58:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Fri, 21 Jan 2022 18:49:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a></p>
<p dir="auto">I tried some experimentation with that but I didn’t get a change in effect.  My original use of marker 0 showed that it wasn’t assigned to any margin.  I tried assigning it to some of the margins using the command you cited, but again it didn’t make a difference.  Of course when the effect is seen visually NOT in any true margin, it is kind of hard to understand how it works.</p>
<p dir="auto">Regardless, the slight downside of not being able to see change indications for lines that will be background-colored by my script is acceptable.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73139</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73139</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jan 2022 18:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Fri, 21 Jan 2022 16:41:24 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>  My only suggestion would be maybe look at <code>SCI_SETMARGINMASKN</code> to see if changing what margins the markers are applied to can make a difference.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73131</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73131</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 21 Jan 2022 16:41:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Thu, 20 Jan 2022 21:35:01 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/73110">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">And this wouldn’t be a point of possible interference anyway.  The interference would be in reusing a marker id number, not how that marker manifests visually on screen.</p>
</blockquote>
<p dir="auto">Agree, but I allow changing a marker type in Changed Lines and if both were trying to use line background coloring, I’m not sure what would happen - a combination of both colors?  Last one to execute wins?  In any case, you’re right - different visuals so visual interference is not the answer in this case.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73112</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73112</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 20 Jan 2022 21:35:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Thu, 20 Jan 2022 21:23:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a> said in <a href="/post/73109">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">if I read your post correctly</p>
</blockquote>
<p dir="auto">I believe you did.</p>
<p dir="auto">So what you’ve said and what I know indicates there should be no interference.  Hmmm…</p>
<p dir="auto">Maybe <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> will have some insight.  Thanks for yours.</p>
<p dir="auto">Free marker (and indicator) allocation could be handled better by N++.  It seems like there should be a “pool” and N++ could hand them out when a plugin (or script) says “gimme a free one”.  Maybe that’s asking too much.</p>
<blockquote>
<p dir="auto">seems you’re using SC_MARK_FULLRECT for ChangedLines and SC_MARK_BACKGROUND for your script.</p>
</blockquote>
<p dir="auto">And this wouldn’t be a point of possible interference anyway.  The interference would be in reusing a marker id number, not how that marker manifests visually on screen.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73110</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73110</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 20 Jan 2022 21:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Thu, 20 Jan 2022 21:17:40 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/73107">How to highlight lines with color one by one?</a>:</p>
<blockquote>
<p dir="auto">I was wondering if <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> or <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a> could shed some light here?</p>
</blockquote>
<p dir="auto">Changed Lines uses markers 10 (changes) and 11 (saves).  I don’t think I leave that customizable - you can change the marker “type”, but not the ID.  Markers I think are cumulative, that is the marker is basically a 32-bit binary number where I’m flipping bits 10 and 11 for ChangedLines and you’re flipping bit 0 or 7 (if I read your post correctly).  The markers aren’t supposed to interfere with each other - seems you’re using <code>SC_MARK_FULLRECT</code> for ChangedLines and <code>SC_MARK_BACKGROUND</code> for your script.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73109</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73109</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 20 Jan 2022 21:17:40 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Thu, 20 Jan 2022 20:43:51 GMT]]></title><description><![CDATA[<p dir="auto">So I noticed some weirdness with this script, specifically, when using it with the <em>ChangedLines</em> plugin, and I do a column insert of data, I expect <em>ChangedLines</em> to color each changed line orange (my set color for unsaved modifications), but I see this instead:</p>
<p dir="auto"><img src="/assets/uploads/files/1642711056530-57c31a80-1d0b-4dea-9ad4-6762b935b6a3-image.png" alt="57c31a80-1d0b-4dea-9ad4-6762b935b6a3-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The orange is there but only on lines not having a marker set by the code above.  I thought maybe the plugin’s code and my code were using the same marker id, but I changed from using 0 to using 7 and the problem persisted.  My thinking here was that even if the plugin uses a few marker ids, and 0 is seemingly used, it wouldn’t use eight marker ids and 7 would be available.</p>
<p dir="auto">Notepad++ source says that 0 - 15 are available for plugins.</p>
<p dir="auto">I <em>think</em> I’ve coded my script to use markers in the right way.</p>
<p dir="auto">I was wondering if <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> or <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a> could shed some light here?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73107</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73107</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 20 Jan 2022 20:43:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Fri, 07 Jan 2022 20:16:45 GMT]]></title><description><![CDATA[<p dir="auto">So the above is really just a “demo”, but, as sometimes happens here, after writing a demo, I find a real use for it.</p>
<p dir="auto">When that happened this time, I noticed that if the script is run while a “view 0” tab is active, it won’t cause the every-other-line shading to happen for a tab in “view 1”.</p>
<p dir="auto">This can be avoided by changing the script code to influence both <code>editor1</code> and <code>editor2</code>.</p>
<p dir="auto">For the marker-based coloring, the marker init code could be changed to:</p>
<pre><code class="language-z">for e in (editor1, editor2):
    e.markerDefine(self.marker_id, marker_symbol)
    e.markerSetBack(self.marker_id, (0xB5, 0xB5, 0xB5))
</code></pre>
<p dir="auto">For the indicator-based coloring, the indicator init code could be changed to:</p>
<pre><code class="language-z">for e in (editor1, editor2):
    e.indicSetStyle(self.indicator_nbr, INDICATORSTYLE.FULLBOX)
    e.indicSetFore(self.indicator_nbr, (0xB5, 0xB5, 0xB5))
    e.indicSetAlpha(self.indicator_nbr, 100)
    e.indicSetOutlineAlpha(self.indicator_nbr, e.indicGetAlpha(self.indicator_nbr))
    e.indicSetUnder(self.indicator_nbr, True)
</code></pre>
<p dir="auto">--<br />
<em>edit: fixed indicator vs marker to make descriptions match code snippets</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/72718</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72718</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 07 Jan 2022 20:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Fri, 31 Dec 2021 12:41:35 GMT]]></title><description><![CDATA[<p dir="auto">So I took <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a>’s suggestion to heart and made a new version of the script that uses markers.  I must say that with the coloring extending past the ends of the lines, it is a better effect.  Here’s <code>BackgroundColorEveryOtherLine2.py</code>:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-
from __future__ import print_function

from Npp import *

#-------------------------------------------------------------------------------

def editor_getLastVisibleLine():  # companion to editor.getFirstVisibleLine()
    first_line = editor.getFirstVisibleLine()
    last_visible_line = first_line + editor.linesOnScreen()
    if 1: # deal with the case where (e.g.) viewport is 40 lines but file has only 10 lines of content
        last_real_line = editor.lineFromPosition(editor.getTextLength())
        if last_real_line &lt; last_visible_line: last_visible_line = last_real_line
    return last_visible_line

def editor_indicClearFromPosToPos(indicator_nbr, start_pos, end_pos):
    # need to do these statements in as quick succession as possible, so that N++ itself doesn't interfere
    editor.setIndicatorCurrent(indicator_nbr)
    editor.indicatorClearRange(start_pos, end_pos - start_pos)

def editor_indicFillFromPosToPos(indicator_nbr, start_pos, end_pos):
    # need to do these statements in as quick succession as possible, so that N++ itself doesn't interfere
    editor.setIndicatorCurrent(indicator_nbr)
    editor.indicatorFillRange(start_pos, end_pos - start_pos)

#-------------------------------------------------------------------------------

class BCEOL_with_indicators(object):

    def __init__(self):
        self.indicator_nbr = 20
        editor.indicSetStyle(self.indicator_nbr, INDICATORSTYLE.FULLBOX)
        editor.indicSetFore(self.indicator_nbr, (0xB5, 0xB5, 0xB5))
        editor.indicSetAlpha(self.indicator_nbr, 100)
        editor.indicSetOutlineAlpha(self.indicator_nbr, editor.indicGetAlpha(self.indicator_nbr))
        editor.indicSetUnder(self.indicator_nbr, True)
        editor.callbackSync(self.updateui_callback, [SCINTILLANOTIFICATION.UPDATEUI])
        self.updateui_callback(None)

    def updateui_callback(self, args):
        for line_nbr in range(editor.getFirstVisibleLine(), editor_getLastVisibleLine() + 1):
            line_start_pos = editor.positionFromLine(line_nbr)
            line_end_pos = editor.getLineEndPosition(line_nbr)
            editor_indicClearFromPosToPos(self.indicator_nbr, line_start_pos, line_end_pos)
            if line_nbr % 2:  # color every other line
                editor_indicFillFromPosToPos(self.indicator_nbr, line_start_pos, line_end_pos)

#-------------------------------------------------------------------------------

class BCEOL_with_markers(object):

    def __init__(self):

        self.marker_id = 0
        marker_symbol = MARKERSYMBOL.BACKGROUND
        editor.markerDefine(self.marker_id, marker_symbol)
        editor.markerSetBack(self.marker_id, (0xB5, 0xB5, 0xB5))
        editor.callbackSync(self.updateui_callback, [SCINTILLANOTIFICATION.UPDATEUI])
        self.updateui_callback(None)

    def updateui_callback(self, args):
        for line_nbr in range(editor.getFirstVisibleLine(), editor_getLastVisibleLine() + 1):
            marker_mask = editor.markerGet(line_nbr)
            has_marker_already = True if (marker_mask &amp; (1 &lt;&lt; self.marker_id)) else False
            if line_nbr % 2:
                if not has_marker_already: editor.markerAdd(line_nbr, self.marker_id)
            else:
                if has_marker_already: editor.markerDelete(line_nbr, self.marker_id)

#-------------------------------------------------------------------------------

if __name__ == '__main__':
    #BCEOL_with_indicators()
    BCEOL_with_markers()

</code></pre>
<p dir="auto">Here’s a sample of its appearance:</p>
<p dir="auto"><img src="/assets/uploads/files/1640954487467-5d126b86-60d5-41ff-9d8e-70b6cc2d317e-image.png" alt="5d126b86-60d5-41ff-9d8e-70b6cc2d317e-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/72515</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72515</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 31 Dec 2021 12:41:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 29 Dec 2021 13:26:48 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> That’s pretty neat. Another option might be to look at markers. SC_MARK_BACKGROUND would give a nice affect since it colors the entire line, not just the text. Though maybe it is easier to manage indicators on each UI update rather than markers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72465</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72465</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Wed, 29 Dec 2021 13:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Wed, 29 Dec 2021 13:14:52 GMT]]></title><description><![CDATA[<p dir="auto">As an alternative method, here’s how to do it with the PythonScript plugin.  I call this script <code>BackgroundColorEveryOtherLine.py</code>.</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-
from __future__ import print_function

from Npp import *

class BCEOL(object):

    def __init__(self):
        self.indicator_nbr = 20
        editor.indicSetStyle(self.indicator_nbr, INDICATORSTYLE.FULLBOX)
        editor.indicSetFore(self.indicator_nbr, (0xB5, 0xB5, 0xB5))
        editor.indicSetAlpha(self.indicator_nbr, 100)
        editor.indicSetOutlineAlpha(self.indicator_nbr, editor.indicGetAlpha(self.indicator_nbr))
        editor.indicSetUnder(self.indicator_nbr, True)
        editor.callbackSync(self.updateui_callback, [SCINTILLANOTIFICATION.UPDATEUI])
        self.updateui_callback(None)

    def getLastVisibleLine(self):  # companion to editor.getFirstVisibleLine()
        first_line = editor.getFirstVisibleLine()
        last_visible_line = first_line + editor.linesOnScreen()
        if 1: # deal with the case where (e.g.) viewport is 40 lines but file has only 10 lines of content
            last_real_line = editor.lineFromPosition(editor.getTextLength())
            if last_real_line &lt; last_visible_line: last_visible_line = last_real_line
        return last_visible_line

    def clear_ind_from_start_to_end(self, start_pos, end_pos):
        editor.setIndicatorCurrent(self.indicator_nbr)
        editor.indicatorClearRange(start_pos, end_pos - start_pos)

    def fill_ind_from_start_to_end(self, start_pos, end_pos):
        editor.setIndicatorCurrent(self.indicator_nbr)
        editor.indicatorFillRange(start_pos, end_pos - start_pos)

    def updateui_callback(self, args):
        for line_nbr in range(editor.getFirstVisibleLine(), self.getLastVisibleLine() + 1):
            line_start_pos = editor.positionFromLine(line_nbr)
            line_end_pos = editor.getLineEndPosition(line_nbr)
            self.clear_ind_from_start_to_end(line_start_pos, line_end_pos)
            if line_nbr % 2:  # color every other line
                self.fill_ind_from_start_to_end(line_start_pos, line_end_pos)

if __name__ == '__main__': BCEOL()
</code></pre>
<p dir="auto">Here’s a bit of the effect:</p>
<p dir="auto"><img src="/assets/uploads/files/1640783681674-72727c0d-5ab1-48f4-b84f-1606e4bae524-image.png" alt="72727c0d-5ab1-48f4-b84f-1606e4bae524-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/72463</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72463</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 29 Dec 2021 13:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to highlight lines with color one by one? on Mon, 27 Dec 2021 12:18:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/heart-strong" aria-label="Profile: heart-strong">@<bdi>heart-strong</bdi></a></p>
<p dir="auto">So really what you are asking is how to make every other line stand out in some way, I would guess so that when your eyes are tracking far away from the line number area, that you can tell which line is which?</p>
<p dir="auto">You can’t do this with Notepad++ as it ships, but you can do it with a scripting plugin.  Here’s an example using the LuaScript plugin:  <a href="https://dail8859.github.io/LuaScript/examples/stylecsv.lua.html" rel="nofollow ugc">https://dail8859.github.io/LuaScript/examples/stylecsv.lua.html</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/72397</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72397</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 27 Dec 2021 12:18:06 GMT</pubDate></item></channel></rss>