File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -790,11 +790,14 @@ void NotepadPlusWrapper::activateBufferID(intptr_t bufferID)
790790{
791791 notAllowedInScintillaCallback (" activateBufferID() cannot be called in a synchronous editor callback. "
792792 " Use an asynchronous callback, or avoid using activateBufferID() in the callback handler" );
793- idx_t index = (idx_t )callNotepad (NPPM_GETPOSFROMBUFFERID, static_cast <WPARAM>(bufferID));
794- UINT view = (index & 0xC0000000 ) >> 30 ;
795- index = index & 0x3FFFFFFF ;
793+ idx_t index = (idx_t )callNotepad (NPPM_GETPOSFROMBUFFERID, static_cast <WPARAM>(bufferID), static_cast <LPARAM>(getCurrentView ()));
794+ if (index != -1 )
795+ {
796+ UINT view = (index & 0xC0000000 ) >> 30 ;
797+ index = index & 0x3FFFFFFF ;
796798
797- callNotepad (NPPM_ACTIVATEDOC, view, (LPARAM)index);
799+ callNotepad (NPPM_ACTIVATEDOC, view, (LPARAM)index);
800+ }
798801}
799802
800803boost::python::str NotepadPlusWrapper::getBufferFilename (intptr_t bufferID)
You can’t perform that action at this time.
0 commit comments