

If it does, it simply uses the value from the cache. When runMenuCommand is called, the cache is first checked if it holds the internal ID for the given Menus are searched for the text, and when found, the internal ID of the menu command is cached.

Use nPluginCommand(pluginName, menuOption)_ For other plugin commands (in the plugin menu), runMenuCommand ( menuName, menuOption ) → bool ¶įor built-in menus use nuCommand(), for non built-in menus (e.g. (note that is different to an empty string, which means that no input was given) Notepad.

Optionally provide the default text to initialise the entry field. Returns: A RESULTxxxx member of MESSAGEBOXFLAGS as to which button was pressed. Title is “Python Script for Notepad++” by default, and flags is 0 by default. messageBox ( message ] ) → MessageBoxFlags ¶ĭisplays a message box with the given message and title.įlags can be 0 for a standard ‘OK’ message box, or a combination of MESSAGEBOXFLAGS. Use the MENUCOMMAND enum, or integers directly from the nativeLang.xml file. Gets the PythonScript plugin version as a string. Gets the Notepad++ version as a tuple - e.g. Gets the directory Notepad++ is running in (i.e. If no bufferID is given, then the language of the currently active buffer is returned. Gets the language type of the given bufferID. If no bufferID is given, then the format of the currently active buffer is returned. Windows, Unix or Mac) of the given bufferID. Returns: A list of tuples containing (filename, bufferID, index, view) Notepad. If no bufferID is given, then the encoding of theĬurrently active buffer is returned.

Get the currently active view (0 or 1) Notepad. Get the current language type Returns: LANGTYPE Notepad. Gets the filename of the active document Notepad. Gets the current active index for the given view (0 or 1) Notepad. Gets the bufferID of the currently active buffer Notepad. Gets the command line used to start Notepad++ Notepad. destroyScintilla ( editor ) ¶ĭestroy a Scintilla handle created with createScintilla Notepad. createScintilla ( ) ¶Ĭreate a new Scintilla handle. closeAllButCurrent ( ) ¶Ĭloses all but the currently active document Notepad. closeAll ( ) ¶Ĭloses all open documents Notepad. close ( ) ¶Ĭloses the currently active document Notepad. Unregisters the callback for the given callback function for the list of events. Unregisters all callbacks for the given list of events.: If this has happened, use one of the other clearCallbacks()įunctions. Note that this uses the actual function object, so if the function hasīeen redefined since it was registered, this will fail. Unregisters all callbacks for the given function.
#Notepad++ sort doc switcher registration
This wayįor Scintilla notifications, see editor.callback() Returns: True if the registration was successful Notepad. Then import that module in the script that calls notepad.callback(). To perform operations whenever a document is opened, saved, changed etc.Īlso note that it is good practice to put the function in another module (file), and Note that the callback will live on past the life of the script, so you can use this The function arguments is a map, and the contents vary dependant on the notification. The NOTIFICATION enum corresponds to the NPPN_* plugin notifications. Console.write("Buffer Activated %d\n" % args
