New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notepad.getFiles() returns incorrect results. #22

Closed
w-p-b opened this Issue Oct 17, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@w-p-b

w-p-b commented Oct 17, 2015

As per issue title, getFiles() sometimes returns incorrect results. See here: https://sourceforge.net/p/npppythonscript/discussion/1188886/thread/bc28b0dd/

I believe the issue has to do with the implementation here: https://github.com/bruderstein/PythonScript/blob/master/PythonScript/src/NotepadPlusWrapper.cpp#L268, specifically:

for(int view = 0; view <= 1; view++)
    {
        count = (idx_t)callNotepad(NPPM_GETNBOPENFILES, 0, view);

The NPP documentation about the above message (at http://docs.notepad-plus-plus.org/index.php/Messages_And_Notifications), states that the message requires the constants PRIMARY_VIEW or SECOND_VIEW, which do not appear to equate to 0 and 1 respectively. (They are, I think, 1 and 2).

The call needs to be something like:

count = (idx_t)callNotepad(NPPM_GETNBOPENFILES, 0, view ? SECOND_VIEW : PRIMARY_VIEW);

I believe that would fix the issue, though I have done no testing. (I don't have a build environment - not just being lazy!)

@chcg chcg added this to the v1.0.9 milestone Apr 14, 2018

@chcg

This comment has been minimized.

Show comment
Hide comment
@chcg

chcg Apr 14, 2018

Collaborator

Fix is part of e65c434

Collaborator

chcg commented Apr 14, 2018

Fix is part of e65c434

@chcg

This comment has been minimized.

Show comment
Hide comment
@chcg

chcg Apr 22, 2018

Collaborator

@w-p-b see https://github.com/bruderstein/PythonScript/releases/tag/v1.0.9, if you want to give it a try. For x64 this beta version is available also via plugin manager.

Collaborator

chcg commented Apr 22, 2018

@w-p-b see https://github.com/bruderstein/PythonScript/releases/tag/v1.0.9, if you want to give it a try. For x64 this beta version is available also via plugin manager.

@chcg chcg closed this May 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment