<?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[NPPM_RELOADFILE should return TRUE _only_ on success]]></title><description><![CDATA[<p dir="auto">Due to the recent change around NPPM_RELOADFILE in Notepad++'s code, this question had arisen.<br />
It has been resolved in the scope of the related opened issue, however I’d like to raise it agin in a little bit different context.</p>
<p dir="auto">As the result of NPPM_DOOPEN, Notepad++ returns either TRUE when the file has been successfully opened or FALSE in case of a failure. And this is the perfect behavior since the caller (originator) of the NPPM_DOOPEN receives a completely clear response that indicates whether the file has actually been opened.<br />
The same applies to NPPM_SWITCHTOFILE.</p>
<p dir="auto">Now, in case of NPPM_RELOADFILE, relayNppMessages is called, <em>but NPPM_RELOADFILE does not return a bool value to indicate whether the reloading was successful or not</em>.<br />
Imagine a plugin that calls NPPM_RELOADFILE. It gets some resulting value, but this resulting value is irrelevant to the file reloading operation. So the plugin can’t rely on the returning code of NPPM_RELOADFILE and has no ability to identify whether the file has actually been reloaded or not.<br />
So, we need NPPM_RELOADFILE to return TRUE only when the file has actually been reloaded and otherwise to return FALSE.<br />
This is not a question of taste. It’s a question of necessity.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25533/nppm_reloadfile-should-return-true-_only_-on-success</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 05:08:42 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25533.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Feb 2024 18:02:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NPPM_RELOADFILE should return TRUE _only_ on success on Mon, 04 Mar 2024 02:11:31 GMT]]></title><description><![CDATA[<p dir="auto">Made it correct in <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/commit/060396c6988e278dbc10208099010947e72be6dc" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/commit/060396c6988e278dbc10208099010947e72be6dc</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/93377</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93377</guid><dc:creator><![CDATA[donho]]></dc:creator><pubDate>Mon, 04 Mar 2024 02:11:31 GMT</pubDate></item><item><title><![CDATA[Reply to NPPM_RELOADFILE should return TRUE _only_ on success on Wed, 28 Feb 2024 08:59:27 GMT]]></title><description><![CDATA[<p dir="auto">I understand that it has always been the case.<br />
What I’m saying now is: this needs to be changed in order to return a meaningful value.<br />
Basically, the change is quite simple:</p>
<p dir="auto">current code:</p>
<pre><code>BufferID id = MainFileManager.getBufferFromName(longNameFullpath);
if (id != BUFFER_INVALID)
    doReload(id, wParam != 0);
</code></pre>
<p dir="auto">proposed code:</p>
<pre><code>result = FALSE;
BufferID id = MainFileManager.getBufferFromName(longNameFullpath);
if (id != BUFFER_INVALID)
    result = doReload(id, wParam != 0) ? TRUE : FALSE;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/93279</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93279</guid><dc:creator><![CDATA[Vitalii Dovgan]]></dc:creator><pubDate>Wed, 28 Feb 2024 08:59:27 GMT</pubDate></item><item><title><![CDATA[Reply to NPPM_RELOADFILE should return TRUE _only_ on success on Tue, 27 Feb 2024 22:06:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vitalii-dovgan" aria-label="Profile: Vitalii-Dovgan">@<bdi>Vitalii-Dovgan</bdi></a></p>
<p dir="auto">See my <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14693#issuecomment-1936545135" rel="nofollow ugc">GitHub comment</a> explaining that this has always been the case.</p>
<p dir="auto"><code>PluginsManager::relayNppMessages</code> does not return anything; it’s a wrapper around the <a href="https://github.com/npp-plugins/plugintemplate/blob/319c80b1161b332a203b7c6df2cadca6d68a9a88/src/PluginInterface.h#L69" rel="nofollow ugc">messageProc</a> plugin API.</p>
<p dir="auto">If your plugin implements <code>messageProc</code>, the input will be <em>message</em>=<code>NPPM_RELOADFILE</code>, <em>WPARAM</em>={0 (no warning dialog) | 1 (warn)}, <em>LPARAM</em>={file path}. Your plugin’s internal logic can then determine whether or not the file is valid, or even resend <code>NPPM_RELOADFILE</code> with different parameters.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/93273</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93273</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Tue, 27 Feb 2024 22:06:51 GMT</pubDate></item><item><title><![CDATA[Reply to NPPM_RELOADFILE should return TRUE _only_ on success on Tue, 27 Feb 2024 19:30:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vitalii-dovgan" aria-label="Profile: Vitalii-Dovgan">@<bdi>Vitalii-Dovgan</bdi></a> ,</p>
<p dir="auto">Makes sense to me.</p>
<p dir="auto">Even the NPPM_RELOADBUFFERID (which does a similar reload, but based on buffer ID instead of file name) returns true/false, so it is definitely strange that NPPM_RELOADFILE always returns true.</p>
<p dir="auto">I don’t see a reason not to put in a feature request to update NPPM_RELOADFILE’s return value to make it useful.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/93272</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/93272</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 27 Feb 2024 19:30:37 GMT</pubDate></item></channel></rss>