• Find results box - F7 to toggle vs. show only

    5
    0 Votes
    5 Posts
    591 Views
    PeterJonesP

    @Wes-Owens

    Here is the procedure, which is 100% reliable for me:

    Ctrl+F, enter search terms, FIND ALL IN CURRENT DOCUMENT Find Dialog closes. Search Results dialog is shown Hitting F7 will toggle between the Search Results and Editor having focus If Search Results has focus, it will have blue title bar If editor has focus, you will be able to type in editor If Search Results has focus, hitting ESC will close it

    See this animated screen grab:

    3ca2bc47-53e2-4871-b24b-80793ab27d1a-SearchResultsF7-ESC.gif

    edit: even if I have the setting that @Terry-R mentioned checkmarked: I see the Search Dialog after hitting the FIND ALL IN CURRENT DOCUMENT button, I still see that the Search Results window is given focus when I do (see the blue title bar for that panel):

    f034944b-732d-455c-a662-8c445c4d0573-image.png

    And when the Search Results have focus, the SINGLE KEY ESC is sufficient to close the panel.

  • Strange crash - but I can't believe it's because of Npp

    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • XBrackets Lite v2.0 has been released!

    4
    3 Votes
    4 Posts
    2k Views
    Vitalii DovganV

    XBrackets Lite v2.0.3

    Glory to Ukraine! Glory to the heroes! fixed: CXBracketsLogic::OnCharPress was truncating a multi-byte character to a single-byte one, thus incorrectly treating e.g. 0x1D5B as 0x5B which is ‘[’.

    https://github.com/d0vgan/npp-XBracketsLite/releases/tag/XBrackets_v203

  • Columns++ display anomaly

    13
    0 Votes
    13 Posts
    3k Views
    CoisesC

    @Laurie-Stearn said in Columns++ display anomaly:

    Out of interest, getting similar behaviour in a UDL when selecting Arial as font as opposed to Consolas:

    <WordsStyle name="COMMENTS" fgColor="008000" bgColor="000000" colorStyle="1" fontName="Arial" fontStyle="2" nesting="0" />

    As before type a long line of text which overflows the wrap limit thus

    texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext

    Then insert before it the opening comment tag:

    /*

    Solid pink line appears below the long line which prevents any cursor movement below with down-arrow.

    Replacing Arial with Consolas for example doesn’t repro.
    Some rare irreproducible glitchiness with pink lines may occur in other situations by just typing the slash instead of the asterisk.

    Edit: Just realised this is for a plugin not installed - the issue seems to be with N++ itself. Sorry.

    When it happened with my plugin (Columns++) the cause turned out to be a wrapped line getting shorter (due to tab layout changing), so that it needed one less wraps. The solution involved temporarily disabling Scintilla’s line cache: something that can cause slow processing in large files with word wrap on. The problem doesn’t happen when editing itself makes the line shorter; it happens when something done after the editing is complete (like recalculating tab widths, or changing styles) causes the line to get shorter.

    My guess is that in this case, the text wraps to n lines after editing, before the new styling is applied; then, when styling is applied, the text only requires n-1 lines for wrapping, and the leftover line is magenta-marked. That marking is a Scintilla “feature” to show that something went wrong. (Why it doesn’t just correct the wrapping instead, I don’t know. Scintilla is open source, but it’s still pretty much a black box to me.)

    The practical fix is probably to avoid specifying different fonts (or font variations with differing widths) for different styles if you expect to use them with word wrap. For performance reasons, turning off the Scintilla line-wrapping cache would not be something Notepad++ would do.

  • Vertical Sidebar for Open Documents in Notepad++

    2
    0 Votes
    2 Posts
    254 Views
    PeterJonesP

    View > Document List

    https://npp-user-manual.org/docs/views/#built-in-panels

    update: once someone replies, DO NOT DELETE YOUR POST. It has been restored.

  • Unicode Normalize: A simple plugin

    4
    5 Votes
    4 Posts
    647 Views
    CoisesC

    @guy038

    I implemented your suggestions in version 1.1.

    Hex values for the Unicode code points are shown if there are no more than eight code points in any of the normalized forms.

  • 2 Minor Requests

    2
    0 Votes
    2 Posts
    877 Views
    PeterJonesP

    @JCB said in 2 Minor Requests:

    It would be nice to have a cancel option in the Create File dialog when trying to open NP++ with a nonexistent file.

    In what way is the “no” button not sufficient for your needs?

    a60caeed-04ac-48d1-b18d-186caea59100-image.png

    Also (since Windows is not real wonderful about restoring all my drive mappings on startup) if a file in the recently used list is on one of those drives, please do not remove it from the recently used list (or give me the option to keep it). Thanks.

    As described in User Manual > Preferences > Recent Files History:
    1340b2c4-4dbb-4fa0-9d9a-64a0ff6077bd-image.png

    Checkmark that option. Then, when Notepad++ launches, it will not remove missing files from the Recent Files History list.

  • JSON String Escape / Unescape

    12
    0 Votes
    12 Posts
    22k Views
    Alexander VerbitskyA

    @Ilia-Nenashev said in JSON String Escape / Unescape:

    Such possibility I have found only in https://github.com/RolandTaverner/npp-json-escape-unescape-plugin but there is some risk of installing compiled plugin from outside of community.

    Well, I’m (the author of the npp-json-escape-unescape-plugin) not that far outside the community. Also, I’ve finally fixed the plugin solution so anyone can build it from source (see the instructions in the README).

  • NppExec v0.8.10 has been released!

    1
    5 Votes
    1 Posts
    278 Views
    No one has replied
  • ViSimulator Not supported anymore?

    10
    0 Votes
    10 Posts
    9k Views
    Dave HouserD

    @PeterJones Thanks for the reply been waiting for something like this for years! Just set up the latest 1.2 version (released yesterday coincidentally) . NppVim is wonderful! It does everything ViSimulator did, it also fixes a few minor issues I have delt with in ViSimulator and added features.

    Fixes:

    Works in newest versions of Npp + 64 bit. Using v $ actually selects to the end of the line now. ViSimulator went to end selection minus one character at the end. Can use Ctrl+f to NP++ find in regular or edit mode. In ViSimulator I needed enter edit mode to use Ctrl+f to find.

    Added feature:

    Can use : <integer> to jump to line numbers now, had to use Ctrl+g to use Npp’s one becuase ViSimulator did not support it. Can now use inputrc commands I used in the past like c i w, and y i w to cut or yank a whole word while in the middle of it

    This is great, I’m really glad this exists now!

  • 0 Votes
    3 Posts
    381 Views
    Revs DeeR

    @PeterJones
    Thank you, that was useful :) I’ve updated shortcuts.xml so Alt+F6 now ignores selected text.

    <Command name="Open new instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_FULL_FILE_PATH) -nosession -multiInst</Command> <Command name="Open selected file path in new instance" Ctrl="no" Alt="no" Shift="no" Key="">$(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst</Command>

    da188c0f-2184-4898-ae3a-b65a5ba09cf8-image.png

    I hadn’t taken a moment before posting to find what Alt+F6 was labelled as. I’ve been using this command via the keyboard shortcut for a long time and not via the Run menu.

    For basic users, I think it could be useful to have this as an out of the box option e.g. File > New Window (Ctrl+Shift+N).

    Thanks again!

  • New plugin: VirtualFolders

    3
    1 Votes
    3 Posts
    473 Views
    Fatih CoşkunF

    @PeterJones,

    As I see it you can only add actual files from the disk to the projects in Project Panel. In VirtualFolders “files” can be just buffers you created in Notepad++. They don’t have to be saved. Most of my buffers are not saved . They are just notes.

    Also you are right new files (saved or unsaved) automatically added in this panel. When you close it, it is automatically removed. Just like in Document List.

  • Looking for Scintilla examples for a Notepad++ plugin

    3
    0 Votes
    3 Posts
    610 Views
    CoisesC

    @John-HUANG-0 said in Looking for Scintilla examples for a Notepad++ plugin:

    I want to write a Notepad++ plugin that can change the font color and background color of certain specific text.

    Depending on your needs, the first thing you should consider is whether you really need a plugin, or whether a User Defined Language could do what you want.

    However, using a method like this:

    SendMessage(hSci, SCI_STYLESETFORE, SCE_USER1, RGB(255, 0, 0));

    is not very efficient, especially when dealing with very large files.

    When making many calls to Scintilla, it is best to use Direct Access. Even better, if you are writing in C++, is to use the ScintillaCall interface. Annoyingly, that interface does not seem to be documented anywhere. You can read the relevant section in the help for my Visual Studio template and, if it makes sense, either use that template or look at the code (start here) to see how it’s done.

    I asked ChatGPT about this, and it suggested that using Lexilla could be much more efficient. I found the Lexilla source code here:
    https://github.com/notepad-plus-plus/notepad-plus-plus/tree/master/scintilla

    I have never attempted to write a lexer, so I can’t give advice there, except to say that unless you are trying to implement full syntax highlighting for a computer language that doesn’t already have a lexer, it’s probably not the way to go. The efficiency problem can be solved by using the direct access interface or ScintillaCall.

  • 4 Votes
    68 Posts
    30k Views
    PeterJonesP

    Notepad++ v8.8.6 Plugins Admin links to CollectionInterface v1.2.0

    comes with Dark Mode support and bulk-mode download (actually from v1.1, which I mentioned over here) v1.2.0 has better handling of -settingsDir and Cloud Directory. (It was implementing the -settingsDir handling which lead to the new v8.8.6 plugin message NPPM_GETNPPSETTINGSDIRPATH , which my plugin uses when Notepad++ version is new enough (though it does have a workaround that works even if you manually install it on an older N++).)

    CollectionInterface v1.3.0 is now available for manual installation:

    When downloading functionList defitions(s) (either on the FunctionList tab, or in bulk along with the UDL), the plugin will ask if you want to update the overrideMap.xml, which allows the functionList to be fully installed through the automatic process, so that functionList will immediately start working, without requiring you to manually update overrideMap.xml to link to the definition. I wasn’t fast enough with this feature to get it in the v8.8.6 Plugins Admin, so it’s manual installation only, for now.
  • Add additional command line parameter for plugins

    2
    1 Votes
    2 Posts
    2k Views
    Vitalii DovganV

    There is one more thing that requires an explicit mentioning in the documentation:

    When exactly NPPN_CMDLINEPLUGINMSG is sent to plugins? In particular, is it sent before or after NPPN_READY? (Currently it is sent before NPPN_READY. But will it be so in the future?)
  • 3 Votes
    1 Posts
    353 Views
    No one has replied
  • SCI_GETCODEPAGE is NOT always either 0 or 65001

    3
    4 Votes
    3 Posts
    4k Views
    CoisesC

    I wrote in SCI_GETCODEPAGE is NOT always either 0 or 65001:

    When I did a test by changing my system default character set to Japanese, I started a new file, set it to ANSI, and pasted in some Japanese text. SCI_GETCODEPAGE was 932. I saved it that way. When I opened it again, the encoding was set to Shift-JIS — not ANSI — and SCI_GETCODEPAGE was 65001.

    For future reference:

    This only happens if Settings | Preferences | MISC | Autodetect character encoding is checked. When it is not checked, the file opens, as expected, as ANSI (SCI_GETCODEPAGE returns 932).

  • Handling Ctrl+C in a c++ plugin dialog

    7
    0 Votes
    7 Posts
    5k Views
    CoisesC

    @PeterJones said in Handling Ctrl+C in a c++ plugin dialog:

    I interpreted as wanting to have a keyboard shortcut specific to an action inside the dialog.
    […]
    It would very much surprise me if it weren’t possible for a plugin to do that (though I cannot think of any off the top of my head that do so). But whether “subclassing” or some other strategy is the right way to implement the shortcut capture is beyond me.

    (Following based on theory/understanding. I have not actually tried to do this.)

    Subclassing the NPP window would be horrific way to go about this (if it would even work at all). Making shortcuts work specifically in a plugin window is a bit of an awkward problem, because (as far as I can tell) there is only one accelerator table for an entire running program — and Notepad++ already “owns” that table.

    In a modal dialog or a non-modal window that was registered with NPPM_MODELESSDIALOG it wouldn’t work at all, because messages for those don’t go through TranslateAccelerator. The message would get sent to the window/dialog. This is actually the right way to go, but subclassing the main NPP window would be irrelevant, because the message would never get to that window; it would be dispatched to the plugin window or one of its controls.

    For a non-modal window without NPPM_MODELESSDIALOG, the shortcut key would still send whatever menu command was assigned to it. In that case, a subclass procedure could check whether the keyboard focus is in a window belonging to the plugin. If it is, process it; if it isn’t, pass it through normally. But note that you’d be catching the command, not the shortcut. Your command would always take over from the NPP command, regardless of whether it was by menu, by tool button, or by whatever shortcut key the user assigned to the NPP function.

    For modeless dialogs that don’t register, NPP now works around this for cut, copy and paste by sending WM_CUT, WM_COPY and WM_PASTE to the window/control with keyboard focus when one of those commands is invoked and focus is not in an NPP-managed window or control. Note that if you change the shortcut for one of those commands, the dialog will respond to the new shortcut. (It will respond to the “normal” shortcut as well if and only if that shortcut isn’t assigned to a Notepad++ command. Scintilla assignments don’t count; that’s why the problem didn’t show up until the shortcuts were moved from Scintilla to Notepad++.)

    So to get it right, you have to register the window if it is modeless, and you have to pick up the key combination in your plugin code. How to pick it up is a bit of a pain in the butt, because usually the main window (typically a dialog box) won’t have focus, so the keystrokes will go to whatever control does have focus — unless the dialog manager captures it and applies its own logic (such as it does for the tab key and for Alt+ accelerators).

    I still haven’t found a clear and complete description of what the dialog manager does when the message loop calls IsDialogMessage. Part of it is bound up with WM_GETDLGCODE, which is sent to controls — not the dialog procedure — which further complicates things. Subclassing every control which could have focus when you want your key combination to work would probably be necessary. I suspect some key combinations cannot be captured, but I don’t know that for a fact.

    It’s messy. Finding another way — like adding a button for your action and then underlining a letter so that Alt+letter will activate it — is likely to be a lot easier and less fragile. (If the action is control-based, rather than independent of which control in your plugin has focus, then of course the way you did it is correct.)

  • 0 Votes
    6 Posts
    4k Views
    Lycan ThropeL

    @PeterJones ,
    Good point. Luckily, it’s still one of a handful of functionList files…at least until you figure out how to mass produce those. :-)

  • [New Plugin] MultiReplace

    76
    3 Votes
    76 Posts
    50k Views
    Thomas KnoefelT

    A new version of MultiReplace (v4.5.0.30) is ready and will be available with the next Notepad++ release. It can be dowloaded here.

    The focus of this release is on expanding the search functionality and giving you more flexibility.

    Implemented updates:

    Find All: This is a new feature that lets you find all matches and see them in the search results window. It’s not limited to the current file – you can also search across all open documents or in entire folders.

    GroupResults: To go with “Find All,” this new INI option lets you choose how your results are displayed. You can see them all mixed together in document order (the default), or neatly grouped by each list entry, which is great for getting a clear overview of complex searches.

    lcmd: A new command for the “Use Variables” feature. It allows you to load your own custom helper functions from external files, which opens up a lot of possibilities for complex and reusable logic.

    AllFromCursor: Another new INI setting that gives you more control. You can now choose to start “Find All”, “Replace All” and “Mark” operations from your current cursor position instead of from the top of the file.

    Here is a visual take on the changes:
    MultiReplace45.png