funap / npp-explorer-plugin

Explorer plugin for Notepad++ x64/x86
GNU General Public License v2.0
86 stars 10 forks source link

Add Quick Open to Explorer context menu #67

Closed vinsworldcom closed 11 months ago

vinsworldcom commented 11 months ago

Is your feature request related to a problem? Please describe. I like the new "Set Root Folder" feature; however, anytime I "Quick Open" now, the fuzzy find begins in the root folder. It would be nice to be able to right-click any folder in the Explorer tree view and even if root folder is set, it would open "Quick Open" in the context of the "right-clicked" folder.

This would not disable the currently set root folder and any other Plugin=>Explorer=>Quick Open searches would originate in the currently set root folder. It would just be nice to have "both" - a shortcut set to Plugin=>Explorer=>Quick Open which opens in the set root folder (if there is) or current folder if there isn't - but always have the ability to right-click a folder and Quick Open in any selected right-clicked folder of the Explorer tree view.

I don't think it would be too hard - just add a Quick Open option to the Context Menu:

npp-explorer-plugin/src/Explorer/ContextMenu.cpp:

239:    /* Add notepad menu items */
240:    if (isFolder) {
+           ::AppendMenu(hMainMenu, MF_STRING, CTX_QUICK_OPEN, _T("Quick Open..."));
241:        ::AppendMenu(hMainMenu, MF_STRING, CTX_NEW_FILE, _T("New File..."));

and associated constants, and then have it call:

npp-explorer-plugin/src/Explorer/ContextMenu.cpp:

411: void ContextMenu::HandleCustomCommand(UINT idCommand)
412: {
413:    switch (idCommand)
414:    {
415:    case CTX_RENAME:
416:        Rename();
417:        break;
+       case CTX_QUICK_OPEN:
+           quickOpenDlg.setRootPath(exProp.szCurrentPath); // (taken from npp-explorer-plugin/src/Explorer/Explorer.cpp:602
+                                                           // obviously would need correct inputs and context - this wouldn't work directly
+           break;

Cheers.

funap commented 11 months ago

@vinsworldcom It's very useful! Thank you for the wonderful feature!