Skip to content

[Ft. Request] NOTIFICATION.MENUCOMMAND #139

Open
@webketje

Description

@webketje

The docs mention an ENUM for MENUCOMMAND, and a method notepad.menuCommand, however it seems impossible to hook into this event with NOTIFICATION. It doesn't seem possible to hook into any generic menucommand.

The NOTIFICATION would ideally be hooked on like so:

def listener(cmd, *args):
    # cmd would be one of the available MENUCOMMAND enum entries
    # in this case args would have the full folder path (or w/e NPP sends as input to the command) as first index
    if cmd == MENUCOMMAND.FILE_OPENFOLDERASWORKSPACE:
        print(args[0]); # C:\Users\xxxxxx\Documents\my-dev-project

notepad.callback(listener, [NOTIFICATION.MENUCOMMAND])

Context of current use case:
I would like to write a Pythonscript that reads the .gitignore file in the root of a folder opened as workspace, then sets the hidden attribute to all files and folders defined in it (this is currently the only way to make Notepad++ skip indexing these files/folders).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions