@rdipardo said:
I would point only out that the documented return value of NPPM_GETCURRENTSCINTILLA is not supported by the actual implementation; the FALSE-returning code path contradicts the statement that this API “Returns always True [sic]”.
Technically so, though the FALSE value only happens when the caller sends an invalid parameter (LPARAM null, when it should be a pointer to an int). There’s also the additional result value of -1, which is documented, but which a comment in the code says “cannot happen”; the equivalent doesn’t exist in NPPM_GETCURRENTVIEW.
What troubled me, though, was that the two calls base their responses on different things. I made some attempt to search the code. As best I could tell, the connection between Notepad_plus::_pEditView and Notepad_plus::_activeView is… haphazard. Even though they sound like they represent the same information in different forms (an integer that represents the main or secondary view as 0 or 1, and a pointer to one of two ScintillaEditView structures that represent the main and secondary views), I can’t “prove” that they always change together. So I cannot be certain that they do not represent different information, used for different purposes.
If NPPM_GETCURRENTVIEW were meant merely to supersede the older, clumsier-to-use NPPM_GETCURRENTSCINTILLA, one would expect it to have been based on the same code (if for no other reason, for clarity). I couldn’t find any explanation of why this call was created or what problem it was meant to solve. So I was hoping perhaps someone would know and remember the rationale for the newer call and/or the purposes of the two different variables on which the calls are based, and could tell me either “they’re the same thing, use whichever you like” or “here is the situation in which they can return different results.”