• 1 Votes
    4 Posts
    624 Views
  • 2 Votes
    28 Posts
    5k Views
    Alan KilbornA

    @slusher59 said in Looking for tips/directions on how to best approach creating a custom plugin for Notepad++:

    is it possible in NPP to display only the search results that have > 0 hits, and hide all searches that returned 0 results?

    As I said before:

    @alan-kilborn said in Looking for tips/directions on how to best approach creating a custom plugin for Notepad++:

    So Search results window and PythonScript don’t typically play well together.

    If you script searches, you have to find your own way of presenting the output to the user.

    One way of doing this is having your script write output to a new (file) tab that it creates. That way you have total control of what goes into the output. You can even make it appear a lot like the usual Search results. If you want to get really fancy, you could even set it up so that double-clicking in this output would open the file where the hit was found.

    It just depends if the time you want to spend on this is better spent scripting or developing a true plugin. But even a true plugin isn’t going to have an easy time of doing custom things with Notepad++'s Search results area.

  • Communicate with authors of XML Tools plugin

    5
    0 Votes
    5 Posts
    711 Views
    Lycan ThropeL

    @michael-vincent
    Ack…my apologies…I was checking NPP XML Treeview. Sorry for that and thanks for the correction. I don’t know how I confused that, because I saw someone post about an update in xml tools and I could have sworn that’s where I went, but it may have been a mis-selection in the installed directory link. :-(

    XMLMistake.PNG

    It was actually this link where I saw that. Thanks for the correction :::slinks away embarrassed::

    Lee

  • Version of Python in script

    7
    0 Votes
    7 Posts
    3k Views
    Paul WormerP

    Earlier I posted a simple calculator script which is based on Python 2.7. In Python 2.7 an integer division yields an integer (as in Fortran). In Python 3 this was changed to yield a float. If the Python 3 behavior is wanted, one must add to the top of the script: from __future__ import division.

  • Python script icon mouseover

    13
    0 Votes
    13 Posts
    1k Views
    Alan KilbornA

    Continuing from above…

    The screenshot directly above is for the fluent icon.

    For a bitmap I found VS shows the “type” a bit differently; I had to invoke “Properties” to see it, example:

    9ef77518-201f-4aff-98b6-09d3e381fa67-image.png

    The properties shown are for the print.bmp file from N++ source.

  • The plugin uses direct from the Windows Console in the app

    11
    0 Votes
    11 Posts
    1k Views
    A

    @wintersilence
    thank’s

  • Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode

    8
    1 Votes
    8 Posts
    2k Views
    matteshM

    @donho
    Was just starting to implement darkmode icons…
    What happens with plugins used in older versions of NPP?
    I guess I’m not the only one facing this for some time.
    I would implement both messages and make the choice by the NPP version:

    if (8 <= HIWORD(execute(nppHandle, NPPM_GETNPPVERSION))) { // version 8 did introduce the dark mode g_TBIconsDrk.hToolbarBmp = (HBITMAP)::LoadImage(_findDlg.getHinst(), MAKEINTRESOURCE(IDB_TB_ANALYSE), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS)); g_TBIconsDrk.hToolbarIcon = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE_NEW)); g_TBIconsDrk.hToolbarIconDarkMode = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE_NEW_DRK)); execute(nppHandle, NPPM_ADDTOOLBARICON_FORDARKMODE, (WPARAM)funcItem[SHOWFINDDLG]._cmdID, (LPARAM)&g_TBIconsDrk); } else { g_TBIconsOld.hToolbarBmp = (HBITMAP)::LoadImage(_findDlg.getHinst(), MAKEINTRESOURCE(IDB_TB_ANALYSE), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS)); g_TBIconsOld.hToolbarIcon = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE)); execute(nppHandle, NPPM_ADDTOOLBARICON_DEPRECATED, (WPARAM)funcItem[SHOWFINDDLG]._cmdID, (LPARAM)&g_TBIconsOld); }

    This works with older versions also.
    Comments?
    rgds, Mattes

  • [C#] Gray Out Plugin's Tab Icon

    8
    0 Votes
    8 Posts
    979 Views
    Alan KilbornA

    @ekopalypse said in [C#] Gray Out Plugin's Tab Icon:

    I agree, but if we stick to the need for questions to be tied to Npp, then I think this question meets the requirement

    Well, I’ve given up trying to police regex questions (because it simply doesn’t work), so in general for other things I just try to hint that people will find better help elsewhere (when they will).

    I do still try to discourage people that ask regex question after regex question from doing that.

    Probably for the toolbar icon question, if answered here the likely advice would show it in PythonScript (well, if I were answering it). That could be helpful to the OP, but probably on the right forum (e.g. StackOverflow ?), code in the desired language to do exactly what is wanted is to be found. Thus getting to a better answer faster and not being off-topic (IMO) on this forum – 2 desirable goals.

  • JSFunctionViewer Plugin Release

    1
    1 Votes
    1 Posts
    564 Views
    No one has replied
  • [C#] Find Text In File

    7
    0 Votes
    7 Posts
    1k Views
    PeterJonesP

    @sover-david said in [C#] Find Text In File:

    I know you can use the Find in Files dialog with NPPM_LAUNCHFINDINFILESDLG but can you use the regular find?

    NPPM_MENUCOMMAND will run any builtin menu with lParam providing the command ID: in this case, IDM_SEARCH_FIND to run Search > Find to launch the FIND dialog.

    // open the FIND dialog SendMessage( npp_hWnd, NPPM_MENUCOMMAND, 0, IDM_SEARCH_FIND);

    Once inside the dialog, you should be able to search controls. If I understand things correctly, FindReplaceDlg_rc.h defines the control ID’s for each of the entries and buttons: in this case, I think you want IDFINDWHAT for the “Find What” text box.

    I am starting to get out of my element, because for Win32 stuff, I am usually using a wrapper libary in Perl rather than truly programming in Win32 API code, so it sometimes provides wrapper functions that don’t map directly to Win32 API calls. But I think you would want to get the hWnd for the FIND dialog and maybe the edit control, then use WM_SETTEXT to the IDFINDWHAT entry:

    find_dlg_hWnd = GetActiveWindow(); // or GetForegroundWindow(); // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getactivewindow find_box_hWnd = GetDlgItem( find_dlg_hWnd , IDFINDWHAT ); // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdlgitem SendMessage( find_box_hWnd, WM_SETTEXT, 0, "search text");

    or maybe instead of getting the extra hwnd, just

    SetDlgItemText( find_dlg_hWnd, IDFINDWHAT, "search text"); // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setdlgitemtexta

    Then somehow, you would have to press the “FIND NEXT” button (but I wasn’t able to find the raw API equivalent of Perl’s Win32::GuiTest::PushChildButton or PushChildById, so I cannot link you to the right API command for pusing the button, sorry).

    But if the SendText/SendWait is working for you, that’s probably sufficient.

    For other reference, the NPP User Manual’s Searching Actions When Recorded As Macros seem to be using the control IDs as the parameters of the macro commands, so that might give you insight into the control IDs needed for other actions in the FIND family of dialogs … though I’m not sure they always line up with teh FindReplaceDlg_rc.h constants, so I’m not sure.

  • [C#] Dockable Dialog Write Text

    5
    0 Votes
    5 Posts
    646 Views
    Sover theS

    @sover-david Alright I managed to find it out, for anyone in the future trying to find the answer, dockable dialogs are made with the Windows Form Designer, you can open it by double-clicking the frmMyDlg.cs file in the Forms folder (should be simple to look up a tutorial on it)

  • Run Compare v2 in cmd

    5
    0 Votes
    5 Posts
    3k Views
    bobbywazB

    Has there been any update in this? I too and trying to script compares for my clients but the compare.exe is still missing. Is there an effort to get the program back in the new release?

  • Unreadable lines when comparing in dark mode

    3
    0 Votes
    3 Posts
    2k Views
    Javier MartinezJ

    @peterjones Thank you!

  • Installing outdated plugin...

    10
    0 Votes
    10 Posts
    1k Views
    artie-finkelsteinA

    @alan-kilborn said in Installing outdated plugin...:

    Or is that just something TextFX will do?

    TextFX only inserts an eight digit line number at the beginning of each line in the currently (stream) marked area. No spaces, no separators, no choices.

    FWIW: My daily use of TextFX is the Add Up Numbers command. Don and the other developers have thankfully implemented code for most of the truly text oriented commands in the Edit menu.

  • Autosave plugin

    11
    0 Votes
    11 Posts
    7k Views
    Ross McMillanR

    @robk-blue A good argument for using Ninite or similar to update your software!

  • Request: default filename is first line of file

    6
    0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @doug-rogers said in Request: default filename is first line of file:

    I’m trying to figure out how to create a shortcut to run this script because it takes a lot of mousing to get to it

    First, you have to tell PythonScript to add it to the menu: Plugins > PythonScript > Configuration…, then select the script and click the left Add button. Then restart Notepad++, and you will see that your chosen script is now at the Plugins > PythonScript > scriptname level instead of buried deeper. Once that’s true, then Notepad++'s Preferences > Shortcut Mapper > Plugin Commands will list your script (you can filter by PythonScript to find it faster), and you can assign a shortcut that way.

  • Add gradient color option

    2
    0 Votes
    2 Posts
    682 Views
    PeterJonesP

    @mudzaky-hilmy ,

    I cannot imagine actually using or desiring such a thing. You are free to ask for new features – but, as the Read Before Posting and FAQ sections thoroughly explain, feature requests in this Community will do no good, and will not be seen by the developer.

    If you do make an official feature request as described in the FAQ, I doubt it will be implemented. And I’d personally prefer that the developer spends time on some of the persistent bugs or feature requests that have been around for years on features that people use every day, rather than on cosmetic things like “gradient backgrounds”. But my preferences don’t decide what actually gets worked on, so who knows what might happen.

  • User-defined language sharing

    3
    1 Votes
    3 Posts
    970 Views
    webketjeW

    @marc-wilson FWIW I bundled 2 with my theme (Dockerfile, markdown): https://github.com/webketje/notepad-plus-plus-duotone-dark-theme/tree/master/userDefineLangs. Other technique for some formats is to re-use existing definitions. E.g. env reg prettierrc eslintrc gitmodules gitattributes dotfiles use a variant of INI file format

  • Easier Way To Add Files In Notepad++

    3
    0 Votes
    3 Posts
    1k Views
    artie-finkelsteinA

    @hyper-ds said in Easier Way To Add Files In Notepad++:

    to make a file

    What about ‘File > New’ followed immediately by ‘File > Save As’?
    It will let you use the folder navigation and creation parts of the Windows file dialog and you can choose the file name when you’ve reached it’s new home. There are also the file tab (right-click) context menu choices to use either an Explorer or cmd session.

    Otherwise, I have to agree with @Ekopalypse that I’m not sure what you’re trying to accomplish.

  • Additional Npp messages needed

    6
    3 Votes
    6 Posts
    797 Views
    pnedevP

    @ekopalypse ,

    I’ve never used Projects or FaW in my workflow and thus I don’t have any experience with them so I cannot be of help here, sorry.
    The suggestions/feedback by others seem reasonable though and having the additional plugins API is a good thing in my opinion for use cases like yours.