Using 64-bit Notepad++ version: 8.75 and Pythonscript version: 3.0021.
Scenario:
- have a cloned document (and other documents as well, in both views)
- obtain the buffer id of the cloned document, e.g. using
x = notepad.getCurrentBufferID() when one of the clones is the active tab
- make the clones be inactive in both view 0 and view 1 by selecting other tabs
- make view 1 the active view
- execute
notepad.activateBufferID(x)
Note that the clone in view 0 is made active, when it should be the clone in view 1 that is made active.
Some analysis:
The activateBufferID code looks like this:
void NotepadPlusWrapper::activateBufferID(intptr_t bufferID)
{
idx_t index = (idx_t)callNotepad(NPPM_GETPOSFROMBUFFERID, static_cast<WPARAM>(bufferID));
UINT view = (index & 0xC0000000) >> 30;
index = index & 0x3FFFFFFF;
callNotepad(NPPM_ACTIVATEDOC, view, (LPARAM)index);
}
The NPPM_GETPOSFROMBUFFERID message takes two arguments, but the PS code only supplies one. The second argument should be supplied and should be the currently active view number.