Giter Club home page Giter Club logo

Comments (6)

rdipardo avatar rdipardo commented on June 10, 2024 2

if (id != BUFFER_INVALID)
doReload(id, wParam != 0);
return TRUE;
}

The call to _pluginsManager.relayNppMessages() at the end of Notepad_plus::process is unreachable because the NPPM_RELOADFILE callback returns immediately, whereas before there was only a break statement in there.

Tip

Documentation changes are best done in separate commits from code changes.

from notepad-plus-plus.

MarkusBodensee avatar MarkusBodensee commented on June 10, 2024 1

For documentation reasons/tracking information: The result value has been adapted to return TRUE on success and FALSE on failure.

See commit:
060396c

from notepad-plus-plus.

d0vgan avatar d0vgan commented on June 10, 2024

In short, NPPM_RELOADFILE should return TRUE on success and return FALSE on failure.
As the "Notepad_plus_msgs.h" says:

#define NPPM_RELOADFILE (NPPMSG + 36)
	//BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload)

from notepad-plus-plus.

vinsworldcom avatar vinsworldcom commented on June 10, 2024

To be clear, we think this is a breaking change in Notepad++, not the plugin.

from notepad-plus-plus.

rdipardo avatar rdipardo commented on June 10, 2024

@vinsworldcom

To be clear, we think this is a breaking change in Notepad++, not the plugin.

What's broken is the (until now) implicit assumption that NPPM_RELOADFILE would be forwarded to plugins via PluginsManager::relayNppMessages. Despite the documentation, the API would have always returned FALSE before (instead of always TRUE as now); the default value of the local result variable was never updated anywhere along the old code path. Plugins can send NPPM_RELOADFILE by themselves as they always could before; they just have to reverse their expectation about the return value.

Having said that, it does not look like a deliberate API change was intended here. In a function that's so overlong the compiler warns about how much local data is pushed to the stack 1, it's easy to forget there's a call site at the bottom.

Footnotes

  1. ...\PowerEditor\src\NppBigSwitch.cpp(256): warning C6262: Function uses '34776' bytes of stack. Consider moving some data to heap. https://github.com/notepad-plus-plus/notepad-plus-plus/actions/runs/7846105861/job/21412038103#step:5:1102

from notepad-plus-plus.

donho avatar donho commented on June 10, 2024

@vinsworldcom
Could you check the PR #14708 please?

from notepad-plus-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.