<?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[Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin]]></title><description><![CDATA[<p dir="auto">Hello, <strong>All</strong>,</p>
<p dir="auto">Quite by chance, I came across a <strong>summary</strong> of the features of the old <strong><code>TextFX</code></strong> plugin, and among them, I took another look at the <strong>Rewrap</strong> feature.</p>
<p dir="auto">First, note that the <strong>rewrap</strong> feature is generally <em>VERY</em> difficult to simulate as it <strong>heavily</strong> depends on <strong>current</strong> text :</p>
<p dir="auto">How do we manage <strong>tables</strong>, <strong>sections</strong>, <strong>lists</strong> with <em>bullets</em> or <em>numbers</em> and possible <strong>leading</strong> indentation of the <strong>folded</strong> lines ?</p>
<p dir="auto">Or do we need to <strong>join</strong> all lines of a text in a single very <strong>looooooooong</strong> line <em>FIRST</em>, before the <strong>wrapping</strong> process ?</p>
<hr />
<p dir="auto">This topic has been discussed <strong>many</strong> times. see, for example, the following posts below :</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/62750">https://community.notepad-plus-plus.org/post/62750</a>, from <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a></p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/54147">https://community.notepad-plus-plus.org/post/54147</a> from mine, where I proposed a <strong>generic</strong> regex</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/78262">https://community.notepad-plus-plus.org/post/78262</a> from <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a>, where he proposed a <strong>Python</strong> script, created with the <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>’s help</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/58881">https://community.notepad-plus-plus.org/post/58881</a> from <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a>, where he proposed a <strong>NppExec</strong> script</p>
<hr />
<p dir="auto">If we look at it from the perspective of the old <strong>TextFX</strong> plugin, it would primarily handle text encoded in <strong>ANSI</strong>. in other words, text where <strong>one</strong> char = <strong>one</strong> byte, for <em>EACH</em> character of the <strong>selected</strong> text !</p>
<p dir="auto">So, before the <strong>wrapping</strong> action, we need to :</p>
<ul>
<li>
<p dir="auto">Use the <strong><code>Edit &gt; Blank Operations &gt; TAB to Space</code></strong> option, in order to replace any <strong>tabulation</strong> with the corresponding amount of <strong>space</strong> chars</p>
</li>
<li>
<p dir="auto">Use the <strong><code>Edit &gt; EOL Conversion &gt; Unix (LF)</code></strong> option. However, I don’t think that a <strong>single</strong> line-ending is really necessary</p>
</li>
<li>
<p dir="auto">Use the <strong><code>Encoding &gt; Convert to ANSI</code></strong> option to get an <strong><code>ANSI</code></strong> text</p>
</li>
</ul>
<p dir="auto">Note that the conversion to <strong><code>ANSI</code></strong> could be a problem if it contains some <strong><code>UNICODE</code></strong> characters, <strong>absent</strong> from the present <strong><code>ANSI</code></strong> encoding. Luckily, the <strong>main</strong> characters are <strong>both</strong> present in the different <strong><code>ANSI</code></strong> encodings and in the <strong><code>Unicode</code></strong> encodings, like <strong>UTF-8</strong> ! Anyway, all the few <strong>non-decoded</strong> characters are generally shown as an <strong>interrogation</strong> mark, within your converted <strong><code>ANSI</code></strong> text !</p>
<ul>
<li>
<p dir="auto">Now, you may use the <strong><code>Edit &gt; Line Operations &gt; Join Lines</code></strong> option, first, <em>ONLY IF</em> you would like a <strong>strict</strong> wraping process throughout all the <strong>selected</strong> text</p>
</li>
<li>
<p dir="auto">Then, you run the <strong>wrapping</strong> process which can be, either, <strong>regex</strong> replacement(s) or a <strong>Python</strong> , <strong>Lua</strong> or <strong>NppExec</strong> script</p>
</li>
</ul>
<hr />
<p dir="auto">So, I created an <strong><code>ANSI</code></strong> file composed of the <strong><code>license.txt</code></strong>, followed with the <strong><code>change.log</code></strong>  file of the <strong><code>N++ v8.9.8</code></strong> release, named <strong><code>ORG_LF_ANSI.txt</code></strong></p>
<p dir="auto">Then I copied this file in some <strong>new</strong> tabs to test the different <strong>scenarios</strong> !</p>
<p dir="auto">In this post <a href="https://community.notepad-plus-plus.org/post/54147">https://community.notepad-plus-plus.org/post/54147</a>, I proposed this <strong>generic</strong> regex replacement :</p>
<p dir="auto">SEARCH <strong><code>(?-s)^(?=.{</code>C<code>})(?:.{1,</code>C-3<code>}\x20|.{</code>C-1<code>})\K</code></strong></p>
<p dir="auto">REPLACE <strong><code>\r\n</code></strong>    ( or <strong><code>\n</code></strong> if <strong>Unix</strong> files )</p>
<p dir="auto">Which <strong>mimics</strong> the <strong><code>Edit &gt; Line Operations &gt; Split Lines</code></strong> option</p>
<p dir="auto">However, it happens that, in <strong>last</strong> N++ releases, this regex replacement should be, rather :</p>
<p dir="auto">SEARCH <strong><code>(?-s)^(?=.{</code>C<code>})(?:.{1,</code>C-2<code>}\x20|.{</code>C-1<code>})\K</code></strong></p>
<p dir="auto">REPLACE <strong><code>\r\n</code></strong>    ( or <strong><code>\n</code></strong> if <strong>Unix</strong> files )</p>
<p dir="auto">If I choose the value <strong><code>78</code></strong> in the <strong><code>Settings &gt; Preferences &gt; Margins/Boder/Edge &gt; Vertical Edge settings</code></strong> dialog, select <strong>all</strong> the text and use the <strong><code>Ctrl + I</code></strong> shortcut, the file is <strong>strictly</strong> identical to the other file using the regex <strong><code>(?-s)^(?=.{78})(?:.{1,76}\x20|.{</code>77<code>})\K</code></strong> with <strong><code>\n</code></strong> as replacement ( Verified with <strong><code>ComparePlus v3.00</code></strong> )</p>
<p dir="auto">Now, it seemed that in these identical files, in many lines the <strong>wrapping</strong> process is done <strong>before</strong> the column <strong><code>78</code></strong>, even considering a <strong>correct</strong> wrapping at <strong>end</strong> of a word !</p>
<p dir="auto">So, I imagined this <strong>new</strong> regex replacement, below :</p>
<p dir="auto">SEARCH <strong><code>(?-s)^(.{1,</code>C<code>})(?:[\x20\r\n]*\z|\x20*\R|\x20+)</code></strong> ( with <strong><code>C = 78</code></strong> in our case )</p>
<p dir="auto">REPLACE <strong><code>\1\r\n</code></strong> if <em>Windows</em> file   <strong><code>\1\n</code></strong> if <em>Unix</em> file   <strong><code>\1\r</code></strong> if <em>Mac</em> file</p>
<p dir="auto">Finally, run an <strong><code>Edit &gt; Blank Operations &gt; Trim Trailing Space</code></strong> operation ( or SEARCH <strong><code>\x20+$</code></strong>  and  REPLACE  with <strong><code>Nothing</code></strong> )</p>
<p dir="auto">And indeed, the <strong><code>New_LF_ANSI.txt</code></strong> file  <strong>better</strong> respects the <strong><code>78</code></strong> limit than the <strong><code>Old_LF_ANSI.txt</code></strong> , as shown below :</p>
<p dir="auto"><strong>BEFORE</strong> :</p>
<p dir="auto"><img src="/assets/uploads/files/1792953195290-6b0ae826-a50a-419a-8a21-329f9224e35a-image.jpeg" alt="6b0ae826-a50a-419a-8a21-329f9224e35a-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">And</p>
<p dir="auto"><img src="/assets/uploads/files/1792953215711-c0580d90-481b-4bac-b261-7cb5ea3b7fe4-image.jpeg" alt="c0580d90-481b-4bac-b261-7cb5ea3b7fe4-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>AFTER</strong> :</p>
<p dir="auto"><img src="/assets/uploads/files/1792953231073-7f5f2cad-1f0c-4706-8465-92c7e99d469e-image.jpeg" alt="7f5f2cad-1f0c-4706-8465-92c7e99d469e-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">And</p>
<p dir="auto"><img src="/assets/uploads/files/1792953243107-bcdc3a1f-ec28-4bb2-8628-1480a38906ac-image.jpeg" alt="bcdc3a1f-ec28-4bb2-8628-1480a38906ac-image.jpeg" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">I also created a <strong><code>New_CRLF_UTF-8.txt</code></strong> file, using the <strong>last</strong> <strong><code>(?-s)^(.{1,78})(?:[\x20\r\n]*\z|\x20*\R|\x20+)</code></strong> regex and the only differences with the <strong><code>New_LF_ANSI.txt</code></strong> file are :</p>
<p dir="auto"><img src="/assets/uploads/files/1792953266356-a0b14962-d8f6-42f7-9635-726c0b814edf-image.jpeg" alt="a0b14962-d8f6-42f7-9635-726c0b814edf-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Because the two chars <strong><code>“</code></strong> and <strong><code>”</code></strong> are coded with <strong>one</strong> byte ( <strong><code>93</code></strong> and <strong><code>94</code></strong> ) in the <em>ANSI</em> text and coded with <strong>three</strong> bytes ( <strong><code>E2 80 9C</code></strong> and <strong><code>E2 80 9D</code></strong> ) in the <em>UTF-8</em> text</p>
<hr />
<p dir="auto">Now, the <strong>wrapping</strong> process of both the <strong><code>TextFX</code></strong> plugin and the <strong><code>Python</code></strong> script are quite <strong>different</strong> : Here is, <strong>successively</strong>, a screenshot from the <strong><code>TextFX_ANSI.txt</code></strong> file and from the <strong><code>PythonCRLF_UTF-8.txt</code></strong> file :</p>
<p dir="auto"><img src="/assets/uploads/files/1792953314340-ab4e772c-e491-444a-9b50-4139e8a8bfcf-image.jpeg" alt="ab4e772c-e491-444a-9b50-4139e8a8bfcf-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1792953332013-e42ce4e9-dd27-4de5-af34-d9d60e2b66b3-image.jpeg" alt="e42ce4e9-dd27-4de5-af34-d9d60e2b66b3-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">You can see, in the <strong>change.log</strong> section, that lines regarding, obviously, <strong>different</strong> points are <strong>badly</strong> concatened in a <strong>single</strong> line !</p>
<p dir="auto">Now, if I compare these two files, ignoring all <strong>spaces</strong> and <strong>line-endings</strong>, <strong><code>ComparePlus v3.00</code></strong> returns the picture, below, with differences <strong>mostly</strong> at <strong>end</strong> of the <strong><code>license.txt</code></strong> section and in the <strong><code>change.log</code></strong> section !</p>
<p dir="auto"><img src="/assets/uploads/files/1792953374856-40d4c827-f326-4b00-9ad0-8f92fd772b00-image.jpeg" alt="40d4c827-f326-4b00-9ad0-8f92fd772b00-image.jpeg" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">Finally, I created the <strong><code>NEW_LF_ANSI_Strict.txt</code></strong> file :</p>
<ul>
<li>
<p dir="auto">I did, <strong>first</strong>, an <strong><code>Edit &gt; Line Operations &gt; Join Lines</code></strong> operation which changed <strong>all</strong> text in a very <strong>long</strong> line ( <strong><code>37,410</code></strong> chars )</p>
</li>
<li>
<p dir="auto">Then, I applied the following <strong>regex</strong> replacement against this file</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-s)^(.{1,78})(?:[\x20\r\n]*\z|\x20*\R|\x20+)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\1\n</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Here is a screenshot of the <strong>resulting</strong> file, showing the <strong>end</strong> of the <strong><code>license.txt</code></strong> section and the <strong>beginning</strong> of the <strong><code>change.log</code></strong> section</p>
<p dir="auto"><img src="/assets/uploads/files/1792954812589-e8139c64-2ec0-45b9-bae7-2a8022451759-image.jpeg" alt="e8139c64-2ec0-45b9-bae7-2a8022451759-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">As you can verify, the reading of this text is rather <strong>painful</strong> :-((</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27693/other-thoughts-regarding-the-rewrap-text-to-clipboard-or-72-width-of-the-old-textfx-plugin</link><generator>RSS for Node</generator><lastBuildDate>Wed, 28 Oct 2026 12:13:16 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27693.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Oct 2026 18:37:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin on Wed, 28 Oct 2026 10:59:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/mpheath" aria-label="Profile: mpheath">@<bdi>mpheath</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah… I understand. Thus, I’ve decided to conduct a <strong>second</strong> round of tests. This time :</p>
<ul>
<li>
<p dir="auto">The files <strong><code>New_LF_ANSI.txt</code></strong> and <strong><code>New_CRLF_UTF-8.txt</code></strong> were copied from <strong><code>ORG_LF_ANSI.txt</code></strong> as <strong><code>Regex_LF_ANSI.txt</code></strong> and <strong><code>Regex_CRLF_UTF-8.txt</code></strong></p>
</li>
<li>
<p dir="auto">The files <strong><code>Lua_LF_ANSI.txt</code></strong> and <strong><code>Lua_CRLF_UTF-8.txt</code></strong> were copied from <strong><code>ORG_LF_ANSI.txt</code></strong> as <strong><code>Lua_2_LF_ANSI.txt</code></strong> and <strong><code>Lua_2_CRLF_UTF-8.txt</code></strong></p>
</li>
</ul>
<p dir="auto">Then, I stopped and restarted N++ : thus, <strong>no</strong> more <strong><code>change history</code></strong> feature !</p>
<p dir="auto">Finally, regarding these <strong>new</strong> created files :</p>
<ul>
<li>
<p dir="auto">I ran the <strong>regex</strong> replacement, followed by a <strong><code>Trim trailing Space</code></strong> operation, on files <strong><code>Regex_LF_ANSI.txt</code></strong> and <strong><code>Regex_CRLF_UTF-8.txt</code></strong></p>
</li>
<li>
<p dir="auto">I ran your <strong><code>Lua</code></strong> script on files <strong><code>Lua_2_LF_ANSI.txt</code></strong> and <strong><code>Lua_2_CRLF_UTF-8.txt</code></strong></p>
</li>
</ul>
<p dir="auto">So, these <strong>four</strong> files showed an <strong>orange</strong> <em>change history</em> color. As you can see on the screenshots, the <strong>regex</strong> process acted on <strong>all</strong> lines, but some <strong>empty</strong> line endings, and your <strong><code>lua</code></strong> script just acted on lines which need <strong>wrapping</strong> !</p>
<p dir="auto"><strong>Regex</strong> process :</p>
<p dir="auto"><img src="/assets/uploads/files/1793185055863-2227cacc-b95f-4715-9de6-41295fb2754d-image.jpeg" alt="2227cacc-b95f-4715-9de6-41295fb2754d-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>Lua</strong> process :</p>
<p dir="auto"><img src="/assets/uploads/files/1793185088657-7b25d2ab-cc71-4e82-9fe3-dc3c4f3cd4fa-image.jpeg" alt="7b25d2ab-cc71-4e82-9fe3-dc3c4f3cd4fa-image.jpeg" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">However, the comparisons between the <strong>regex</strong> process and the <strong><code>Lua</code></strong> process shows the <strong>same</strong> number of differences ( <strong><code>3</code></strong> for <strong><code>ANSI</code></strong> files and <strong><code>5</code></strong> for <strong><code>UTF-8</code></strong> files )</p>
<ul>
<li>Between <strong><code>ANSI</code></strong> files :</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1793185122897-7299ef9e-d2d0-46f5-9d1c-a9a4a69473a4-image.jpeg" alt="7299ef9e-d2d0-46f5-9d1c-a9a4a69473a4-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1793185134970-7e206be6-1745-46b2-9751-5fdd94e5a2a6-image.jpeg" alt="7e206be6-1745-46b2-9751-5fdd94e5a2a6-image.jpeg" class=" img-fluid img-markdown" /></p>
<ul>
<li>Between <strong><code>UTF-8</code></strong> files</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1793185153982-bd94b573-9462-4640-99f2-ed0ecbec9ced-image.jpeg" alt="bd94b573-9462-4640-99f2-ed0ecbec9ced-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1793185170805-785051c7-9e8b-476c-8024-9cb249e18ded-image.jpeg" alt="785051c7-9e8b-476c-8024-9cb249e18ded-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106626</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106626</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 28 Oct 2026 10:59:43 GMT</pubDate></item><item><title><![CDATA[Reply to Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin on Tue, 27 Oct 2026 17:34:20 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> The Change History markers and indicators should be evaluated also as part of the tests. All green markers in the images is suspiciously odd. Perhaps all of the text was pasted and saved which caused that to occur? With Change History showing what changed, the view of what is better may change.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106623</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106623</guid><dc:creator><![CDATA[mpheath]]></dc:creator><pubDate>Tue, 27 Oct 2026 17:34:20 GMT</pubDate></item><item><title><![CDATA[Reply to Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin on Tue, 27 Oct 2026 12:31:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/mpheath" aria-label="Profile: mpheath">@<bdi>mpheath</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a> and <strong>all</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mpheath" aria-label="Profile: mpheath">@<bdi>mpheath</bdi></a>, I <strong>first</strong> copied the <strong><code>ORG_LF_ANSI.txt</code></strong> file as <strong><code>Lua_LF_ANSI.txt</code></strong> then I ran your <strong>last</strong> <strong><code>lua</code></strong> script against this file and the files are <strong>almost</strong> identical, except in the <strong><code>3</code></strong> locations below :</p>
<p dir="auto"><img src="/assets/uploads/files/1793099502965-4880d578-51d5-4405-8ec8-a7883a73ba30-image.jpeg" alt="4880d578-51d5-4405-8ec8-a7883a73ba30-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1793099529811-36b4d4bd-062a-4df3-82fe-ffd2ea034157-image.jpeg" alt="36b4d4bd-062a-4df3-82fe-ffd2ea034157-image.jpeg" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">Then I copied again the <strong><code>ORG_LF_ANSI.txt</code></strong> file as <strong><code>Lua_CRLF_UTF-8.txt</code></strong> then I ran your <strong>last</strong> <strong><code>lua</code></strong> script against this file. This time, there are <strong><code>5</code></strong> differences, shown below :</p>
<p dir="auto"><img src="/assets/uploads/files/1793099767481-0f7eee6f-9e87-494e-92b1-2ef95fcf4ea5-image.jpeg" alt="0f7eee6f-9e87-494e-92b1-2ef95fcf4ea5-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1793099783194-9b5ec0fe-6c19-49b6-91a1-1c52166e7b61-image.jpeg" alt="9b5ec0fe-6c19-49b6-91a1-1c52166e7b61-image.jpeg" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">Thus, as a conclusion, your <strong><code>Lua</code></strong> script is <strong>quite</strong> correct but the <strong>last</strong> regex solution :</p>
<p dir="auto">SEARCH <strong><code>(?-s)^(.{1,78})(?:[\x20\r\n]*\z|\x20*\R|\x20+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\1\n</code></strong> ( for <em>Unix</em> files ) or <strong><code>\1\r\n</code></strong> ( for <em>Windows</em> files )</p>
<p dir="auto">Followed with a <strong><code>Trim Trailing Space</code></strong> operation, seems <strong>slightly</strong> better !</p>
<hr />
<p dir="auto">Now, <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a>, you said :</p>
<blockquote>
<p dir="auto">What is the problem to be solved?</p>
</blockquote>
<p dir="auto">Well, I just wanted to point out that, in <strong>particular</strong> cases, a simple <strong>wrapping</strong> operation may not give the <strong>expected</strong> display, from the user’s perspective ! In my opinion, it seems <strong>better</strong> to use the present <a class="plugin-mentions-user plugin-mentions-a" href="/user/mpheath" aria-label="Profile: mpheath">@<bdi>mpheath</bdi></a>’s <strong><code>Lua</code></strong> script ( or an equivalent <strong><code>Python</code></strong> one ) or the <strong>regex</strong> solution above rather than the <strong>odd</strong> solution provided by the <strong><code>TextFX</code></strong> plugin.</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto">Oh…, I forgot to tell you, <a class="plugin-mentions-user plugin-mentions-a" href="/user/mpheath" aria-label="Profile: mpheath">@<bdi>mpheath</bdi></a>, that I <strong>changed</strong> the line :</p>
<pre><code class="language-lua">    local maxLineLength = 72
</code></pre>
<p dir="auto">By this one :</p>
<pre><code class="language-lua">    local maxLineLength = 78
</code></pre>
<p dir="auto">For <strong>all</strong> the tests !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106619</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106619</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 27 Oct 2026 12:31:28 GMT</pubDate></item><item><title><![CDATA[Reply to Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin on Mon, 26 Oct 2026 16:51:01 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> <a href="/post/106608">said</a>:</p>
<blockquote>
<p dir="auto">Quite by chance, I came across a <strong>summary</strong> of the features of the old <strong><code>TextFX</code></strong> plugin, and among them, I took another look at the <strong>Rewrap</strong> feature.</p>
<p dir="auto">First, note that the <strong>rewrap</strong> feature is generally <em>VERY</em> difficult to simulate as it <strong>heavily</strong> depends on <strong>current</strong> text :</p>
<p dir="auto">How do we manage <strong>tables</strong>, <strong>sections</strong>, <strong>lists</strong> with <em>bullets</em> or <em>numbers</em> and possible <strong>leading</strong> indentation of the <strong>folded</strong> lines ?</p>
<p dir="auto">Or do we need to <strong>join</strong> all lines of a text in a single very <strong>looooooooong</strong> line <em>FIRST</em>, before the <strong>wrapping</strong> process ?</p>
</blockquote>
<p dir="auto">As far as I can tell, the old TextFX didn’t handle any of the more complex cases (tables, lists, indentation). I have not been able to find user documentation. The closest reasonably accessible code I could find was <a href="https://github.com/HQJaTu/NPPTextFX/blob/ab42d410bcd23bdf39018a9e1b02a59c9018fd72/SRC/NPPTextFX.cpp#L1945" rel="nofollow ugc">this for the rewrap function</a>, which has comments suggesting some fancier processing might be possible, but it doesn’t implement it.</p>
<p dir="auto">Do any of the scripts or proposals offered so far do anything that can’t be accomplished with the native Split Lines function? Split Lines splits at the edge of the view if you have no vertical edges set, and at the last (or only) vertical edge listed if you do. (So if you list <code>72 80</code> it will split at 80; if you list <code>80 72</code> it will split at 72.)</p>
<p dir="auto">What is the problem to be solved?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106615</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106615</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 26 Oct 2026 16:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin on Mon, 26 Oct 2026 09:48:50 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> Seems like regex Wrap versus the others using ReWrap. The test does not appear to be an equal comparison.</p>
<p dir="auto">The test input files are UnWrapped. ReWrap would probably be for lines that are already Wrapped. Neither of the test files have a fully strict form of paragraphs. The license file is mostly paragraphs except for some lines.</p>
<pre><code>GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
</code></pre>
<p dir="auto">These 2 lines are supposed to remain as 2 lines, not 1 paragraph. So if treated with ReWrap, would probably result as 1 line.</p>
<p dir="auto">Wrap can be done with this Lua code:</p>
<pre><code>local function main()
    local maxLineLength = 72
    local line = 0
    local eol = ({'\r\n', '\r', '\n'})[editor.EOLMode + 1]

    editor:BeginUndoAction()

    while 1 do
        local lineLength = editor:LineLength(line)

        if lineLength &lt; 1 then
            break
        end

        if lineLength &gt; maxLineLength then
            local startPos = editor:PositionFromLine(line)
            local endPos = editor.LineEndPosition[line]
            local maxPos = startPos + maxLineLength
            local breakPos

            for i = startPos, endPos do
                local posAfter = editor:PositionAfter(i)

                if posAfter &gt; (i + 1) then
                    maxPos = maxPos + posAfter - i - 1
                end

                if editor.CharAt[i] == 0x20 then
                    if breakPos and i &gt; maxPos then
                        break
                    end

                    breakPos = i
                end
            end

            if breakPos and breakPos &lt; endPos then
                editor:SetTargetRange(breakPos, breakPos + 1)
                editor:ReplaceTarget(eol)
            end
        end

        line = line + 1
    end

    editor:EndUndoAction()
end


main()
</code></pre>
<p dir="auto">It replaces the space &lt;= 72+ to break at with an EOL. Suggest to keep the original unwrapped copy as I have no UnWrap or ReWrap code.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106613</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106613</guid><dc:creator><![CDATA[mpheath]]></dc:creator><pubDate>Mon, 26 Oct 2026 09:48:50 GMT</pubDate></item></channel></rss>