<?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[Preserve Style Tokens at Reload of File]]></title><description><![CDATA[<p dir="auto">For analysing log files, the Notepad++ feature of applying style tokens is extremely helpful. Sadly, all of these tokens are gone, as soon as the log file is reloaded.</p>
<p dir="auto">For you people that are more into Notepad++ what is your advice: may this be possible via macro or should I create a feature request?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24596/preserve-style-tokens-at-reload-of-file</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 05:25:56 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24596.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Jun 2023 12:12:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Fri, 23 Jun 2023 15:53:40 GMT]]></title><description><![CDATA[<p dir="auto">Haaaa … what a pity, just found a problem with using this solution for my use case:<br />
The style highlightnings are being stored/restored for each occurence. This means, newly appended log file lines won’t get the matching style highlightnings.</p>
<p dir="auto">(I tested the AnalysePlugin also, but - as expected - it is too bulky, buggy and restricted to its own result window; there are good use cases for this solution for repeating scenarios with identical and complex patterns, but it won’t fit for dynamic quick’n’easy highlightnings of always-other-keywords)</p>
<p dir="auto">Will go back to manually re-applying the 1-5 style tokens at each log file reload, until I find a better solution.</p>
<p dir="auto">Thanks for all suggestions and ideas, this was really inspiring!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87363</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87363</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Fri, 23 Jun 2023 15:53:40 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Fri, 23 Jun 2023 08:03:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> said in <a href="/post/87350">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">You know, I just remembered a plugin that could probably be helpful for this task, <a href="https://sourceforge.net/projects/analyseplugin/" rel="nofollow ugc">AnalysePlugin</a>. I haven’t used it much myself, but it claims to be designed for log analysis and it looked promising when I tried it out.</p>
</blockquote>
<p dir="auto">Never thought of looking for specialised software for that. Thank you for this idea, already installed it, will try this out!<br />
(as this looks quite sophisticated and may be really powerful and helpful, I think for quick log analyses it may be too bulky - maybe not, I will see - but if, I will use your script as well, cause it is quite slim and straightforward)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87352</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87352</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Fri, 23 Jun 2023 08:03:49 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Fri, 23 Jun 2023 00:36:17 GMT]]></title><description><![CDATA[<p dir="auto">You know, I just remembered a plugin that could probably be helpful for this task, <a href="https://sourceforge.net/projects/analyseplugin/" rel="nofollow ugc">AnalysePlugin</a>. I haven’t used it much myself, but it claims to be designed for log analysis and it looked promising when I tried it out.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87350</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87350</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Fri, 23 Jun 2023 00:36:17 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 16:31:35 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/87327">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> said in <a href="/post/87318">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">can you please help me in finding what you referred to?</p>
</blockquote>
<p dir="auto">Try:</p>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/18134/style-token-not-saved/">https://community.notepad-plus-plus.org/topic/18134/style-token-not-saved/</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/18052/bookmark-by-style">https://community.notepad-plus-plus.org/topic/18052/bookmark-by-style</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21778/whenever-i-color-something-save-close-the-app-and-open-the-same-thing-again-all-the-colors-are-gone">https://community.notepad-plus-plus.org/topic/21778/whenever-i-color-something-save-close-the-app-and-open-the-same-thing-again-all-the-colors-are-gone</a></li>
</ul>
</blockquote>
<p dir="auto">thank you very much Alan!</p>
<p dir="auto">I took your script and modified it to fit my needs. What am I talking about? For my use case, it is not necessary to create individual style files, as a log analysis task that is done will purge the need for these specific style token setups.</p>
<p dir="auto">Therefore, I changed the script to use one style file (like in your first draft version of the script):</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

# references:
#  https://community.notepad-plus-plus.org/topic/18134/style-token-not-saved/

from Npp import *
import inspect
import os

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

class SSOL2(object):

    def __init__(self):

        self.debug = True if 0 else False
        if self.debug:
            pass
            #console.show()
            #console.clear()
        self.this_script_name = inspect.getframeinfo(inspect.currentframe()).filename.split(os.sep)[-1].rsplit('.', 1)[0]

        # identifiers pulled from N++ source code:
        SCE_UNIVERSAL_FOUND_STYLE_EXT1 = 25  # N++ style 1 indicator number
        SCE_UNIVERSAL_FOUND_STYLE_EXT2 = 24  # N++ style 2 indicator number
        SCE_UNIVERSAL_FOUND_STYLE_EXT3 = 23  # N++ style 3 indicator number
        SCE_UNIVERSAL_FOUND_STYLE_EXT4 = 22  # N++ style 4 indicator number
        SCE_UNIVERSAL_FOUND_STYLE_EXT5 = 21  # N++ style 5 indicator number
        SCE_UNIVERSAL_FOUND_STYLE      = 31  # N++ red-"mark" feature highlighting style indicator number

        self.indicator_number_list = [
            SCE_UNIVERSAL_FOUND_STYLE_EXT1,
            SCE_UNIVERSAL_FOUND_STYLE_EXT2,
            SCE_UNIVERSAL_FOUND_STYLE_EXT3,
            SCE_UNIVERSAL_FOUND_STYLE_EXT4,
            SCE_UNIVERSAL_FOUND_STYLE_EXT5,
            SCE_UNIVERSAL_FOUND_STYLE,
        ]

    def get_data_file_path_for_active_tab(self):
	return notepad.getPluginConfigDir() + '\PythonScript\styleTokenBuffer.sty'
        # active_file_pathname = notepad.getCurrentFilename()
        # if not os.path.isfile(active_file_pathname): return None
        # if active_file_pathname.endswith('.sty'): return None
        # data_file_for_active_tab = active_file_pathname.rsplit('.', 1)[0] + '.sty'
        # return data_file_for_active_tab

    def save_data_file(self):
        data_file_for_active_tab = self.get_data_file_path_for_active_tab()
        if data_file_for_active_tab == None:
            self.mb('Problem saving styling data for active tab file')
            return
        with open(data_file_for_active_tab, 'w') as fo:
            for indic_number in self.indicator_number_list:
                for (styled_start_pos, styled_end_pos) in self.highlight_indicator_range_tups_generator(indic_number):
                    fo.write('{i} {start} {stop}\n'.format(i=indic_number, start=styled_start_pos, stop=styled_end_pos))

    def load_data_file(self):
        data_file_for_active_tab = self.get_data_file_path_for_active_tab()
        if data_file_for_active_tab == None or not os.path.isfile(data_file_for_active_tab):
            self.mb('Problem loading styling data for active tab file')
            return
        with open(data_file_for_active_tab) as fi:
            for line in fi:
                (indic, start, end) = line.rstrip().split()
                editor.setIndicatorCurrent(int(indic))
                editor.indicatorFillRange(int(start), int(end) - int(start))

    def run(self):
        saving_not_loading = self.yes_no_cancel('\r\n'.join([
            "SAVE current doc's styling to disk file?\r\n",
            "YES = Yes, please SAVE it",
            "NO = LOAD styling info from file and apply to current doc",
            "CANCEL = I'm outta here"]))
        if saving_not_loading == None: return
        self.save_data_file() if saving_not_loading else self.load_data_file()

    def highlight_indicator_range_tups_generator(self, indicator_number):
        '''
        the following logic depends upon behavior that isn't exactly documented;
        it was noticed that calling editor.indicatorEnd() will yield the "edge"
        (either leading or trailing) of the specified indicator greater than the position
        specified by the caller
        this is definitely different than the scintilla documentation:
        "Find the start or end of a range with one value from a position within the range"
        '''
        if editor.indicatorEnd(indicator_number, 0) == 0: return
        indicator_end_pos = 0  # set special value to key a check the first time thru the while loop
        while True:
            if indicator_end_pos == 0 and editor.indicatorValueAt(indicator_number, 0) == 1:
                # we have an indicator starting at position 0!
                # when an indicator highlight starts at position 0, editor.indicatorEnd()
                #  gives us the END of the marking rather than the beginning;
                #  have to compensate for that:
                indicator_start_pos = 0
            else:
                indicator_start_pos = editor.indicatorEnd(indicator_number, indicator_end_pos)
            indicator_end_pos = editor.indicatorEnd(indicator_number, indicator_start_pos)
            if indicator_start_pos == indicator_end_pos: break  # no more matches
            yield (indicator_start_pos, indicator_end_pos)

    def print(self, *args):
        if self.debug:
            print(self.__class__.__name__ + ':', *args)

    def mb(self, msg, flags=0, title=''):  # a message-box function
        return notepad.messageBox(msg, title if title else self.this_script_name, flags)

    def yes_no_cancel(self, question_text):
        retval = None
        answer = self.mb(question_text, MESSAGEBOXFLAGS.YESNOCANCEL, self.this_script_name)
        if answer == MESSAGEBOXFLAGS.RESULTYES: retval = True
        elif answer == MESSAGEBOXFLAGS.RESULTNO: retval = False
        return retval

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

if __name__ == '__main__':
    SSOL2().run()
</code></pre>
<p dir="auto">Please note that the comment I wrote in the other thread applies to both versions of your script: the unmodified and modified versions.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87344</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87344</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Thu, 22 Jun 2023 16:31:35 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 10:55:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> said in <a href="/post/87318">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">can you please help me in finding what you referred to?</p>
</blockquote>
<p dir="auto">Try:</p>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/18134/style-token-not-saved/">https://community.notepad-plus-plus.org/topic/18134/style-token-not-saved/</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/18052/bookmark-by-style">https://community.notepad-plus-plus.org/topic/18052/bookmark-by-style</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21778/whenever-i-color-something-save-close-the-app-and-open-the-same-thing-again-all-the-colors-are-gone">https://community.notepad-plus-plus.org/topic/21778/whenever-i-color-something-save-close-the-app-and-open-the-same-thing-again-all-the-colors-are-gone</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/87327</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87327</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 22 Jun 2023 10:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 09:07:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> said in <a href="/post/87315">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<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/87213">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a></p>
<p dir="auto">There are some scripts to be found on this site that do such a thing, plus the author of Notepad++ hinted that this would become a native feature, see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12684" rel="nofollow ugc">HERE</a> (but in the intervening time may have lost enthusiasm for that feature). :-(</p>
</blockquote>
<p dir="auto">ok thank you for this hint - I will search for them.</p>
</blockquote>
<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>, can you please help me in finding what you referred to?<br />
I tried searching the site manually, via tags and via search engine, but didn’t found anything else than this thread and one other that requested something else… :D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87318</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87318</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Thu, 22 Jun 2023 09:07:52 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 08:37:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mkupper" aria-label="Profile: mkupper">@<bdi>mkupper</bdi></a> said in <a href="/post/87217">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> said in <a href="/post/87207">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">s is extremely helpful. Sadly, all of these tokens are gone, as soon as the log file is reloaded.<br />
For you people that are more into Notepad++ what is your advice:</p>
</blockquote>
<p dir="auto">It’s not an area I personally am familiar with setting up but perhaps Notepad++'s language feature would do the trick. Notepad++'s language feature allows the foreground and background colors to be set based on the content of the file you are working work.</p>
<p dir="auto">You would be setting up what’s known as a User Defined Language (UDL) that would color code your log files.</p>
<p dir="auto"><a href="https://npp-user-manual.org/docs/user-defined-language-system/" rel="nofollow ugc">https://npp-user-manual.org/docs/user-defined-language-system/</a></p>
</blockquote>
<p dir="auto">We are already using exactly this mechanism for basic expression coloring of our log files.<br />
This applies on the basic structure of the log file entries like e. g. timestamps, category, level.<br />
Additionally all numbers and specific keywords are being highlighted.<br />
This is already a huge improvement of readability and we won’t miss that.</p>
<p dir="auto">Now this is the basic environment of reading the logs. Then the contextual quest has to be found within the current logs - and this is where individual highlightnings step into.<br />
This is all well for finished logs, because all style tokens will remain there.<br />
But for live debugging an application, the nature of log files is to be appended all over the time. At reload of the log file, for being able to see the newly appended lines, all style tokens will be gone then.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87317</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87317</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Thu, 22 Jun 2023 08:37:25 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 08:39:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> said in <a href="/post/87215">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">So just thinking out loud, maybe a good way to remember styled tokens would be to put something like this in <code>config.xml</code>:</p>
<pre><code>&lt;StyledTokens&gt;
    &lt;StyledToken styleId="1" fileName="path\\to\\foo.txt" token="foo" /&gt;
    &lt;StyledToken styleId="2" fileName="path\\to\\bar.md" token="bar" /&gt;
&lt;/StyledTokens&gt;
</code></pre>
<p dir="auto">If we remembered styled tokens this way, the next time Notepad++ opened <code>path\\to\\foo.txt</code> it would apply marker <code>1</code> to the token <code>foo</code>, and it would apply marker <code>2</code> to the token <code>bar</code> in <code>path\\to\\bar.txt</code>. Would this meet your needs, <a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> ?</p>
</blockquote>
<p dir="auto">This is another great idea and I am sure that me and many other will find great use cases for it. [edit: see my following post, there is already a use case and it is fulfilled, using language coloring]</p>
<p dir="auto">For my current request this won’t fit exactly, I’m afraid to tell.<br />
This is because for log analysis, the phrases to select are volatile - for now this may be id 123 and next time it may be id 234, while being both combined with expression “did some nasty stuff”; next case won’t be focussed on the latter, but will try to correlate with “was affected in another way”.</p>
<p dir="auto">So there would be no need for saving these tokens permanently, but just between reloads of the current file (that clears all of the tokens currently).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87316</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87316</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Thu, 22 Jun 2023 08:39:44 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Thu, 22 Jun 2023 08:12:29 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/87213">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a></p>
<p dir="auto">There are some scripts to be found on this site that do such a thing, plus the author of Notepad++ hinted that this would become a native feature, see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12684" rel="nofollow ugc">HERE</a> (but in the intervening time may have lost enthusiasm for that feature). :-(</p>
</blockquote>
<p dir="auto">ok thank you for this hint - I will search for them.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87315</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87315</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Thu, 22 Jun 2023 08:12:29 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 19:38:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> said in <a href="/post/87215">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">So just thinking out loud, maybe a good way to remember styled tokens would be to put something like this in config.xml</p>
</blockquote>
<p dir="auto">I haven’t compared your idea with it, but “bookmarks” <em>are</em> remembered in the current session (e.g. session.xml).  Thus config.xml isn’t the place for it.  But, overall, probably modeling support for this after how bookmarks are supported is the way to go.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87220</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87220</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 19 Jun 2023 19:38:29 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 15:24:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> said in <a href="/post/87207">Preserve Style Tokens at Reload of File</a>:</p>
<blockquote>
<p dir="auto">s is extremely helpful. Sadly, all of these tokens are gone, as soon as the log file is reloaded.<br />
For you people that are more into Notepad++ what is your advice:</p>
</blockquote>
<p dir="auto">It’s not an area I personally am familiar with setting up but perhaps Notepad++'s language feature would do the trick. Notepad++'s language feature allows the foreground and background colors to be set based on the content of the file you are working work.</p>
<p dir="auto">You would be setting up what’s known as a User Defined Language (UDL) that would color code your log files.</p>
<p dir="auto"><a href="https://npp-user-manual.org/docs/user-defined-language-system/" rel="nofollow ugc">https://npp-user-manual.org/docs/user-defined-language-system/</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/87217</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87217</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Mon, 19 Jun 2023 15:24:26 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 14:56:56 GMT]]></title><description><![CDATA[<p dir="auto">So just thinking out loud, maybe a good way to remember styled tokens would be to put something like this in <code>config.xml</code>:</p>
<pre><code>&lt;StyledTokens&gt;
    &lt;StyledToken styleId="1" fileName="path\\to\\foo.txt" token="foo" /&gt;
    &lt;StyledToken styleId="2" fileName="path\\to\\bar.md" token="bar" /&gt;
&lt;/StyledTokens&gt;
</code></pre>
<p dir="auto">If we remembered styled tokens this way, the next time Notepad++ opened <code>path\\to\\foo.txt</code> it would apply marker <code>1</code> to the token <code>foo</code>, and it would apply marker <code>2</code> to the token <code>bar</code> in <code>path\\to\\bar.txt</code>. Would this meet your needs, <a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a> ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87215</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87215</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Mon, 19 Jun 2023 14:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 14:48:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a></p>
<p dir="auto">There are some scripts to be found on this site that do such a thing, plus the author of Notepad++ hinted that this would become a native feature, see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12684" rel="nofollow ugc">HERE</a> (but in the intervening time may have lost enthusiasm for that feature). :-(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87213</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87213</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 19 Jun 2023 14:48:35 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 14:42:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> <img src="/assets/uploads/files/1687185553162-6e3a4a50-a202-4fae-94e0-44fbcbea1f2f-grafik.png" alt="6e3a4a50-a202-4fae-94e0-44fbcbea1f2f-grafik.png" class=" img-fluid img-markdown" /></p>
<ol>
<li>double click on a word</li>
<li>open context menu of/on this word selection</li>
<li>open subgroup “style token” (other expression in other languages??)</li>
<li>select one of the colors</li>
<li>all of the occurences throughout the whole file (!) of the selected word are now marked with the color, selected in step 4</li>
</ol>
<p dir="auto">Extremely great feature, I use it extensively! :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87212</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87212</guid><dc:creator><![CDATA[nsk7even]]></dc:creator><pubDate>Mon, 19 Jun 2023 14:42:15 GMT</pubDate></item><item><title><![CDATA[Reply to Preserve Style Tokens at Reload of File on Mon, 19 Jun 2023 14:31:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nsk7even" aria-label="Profile: nsk7even">@<bdi>nsk7even</bdi></a><br />
What do you mean by “style tokens?”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87211</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87211</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Mon, 19 Jun 2023 14:31:06 GMT</pubDate></item></channel></rss>