Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

notepad.activateBufferID can activate incorrect cloned document #382

Copy link
Copy link

Description

@alankilborn
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.