• Read This First

    Pinned Locked
    1
    5 Votes
    1 Posts
    5k Views
    No one has replied
  • New API to fix eventual regression regarding SCN_MODIFIED for some plugins

    Pinned
    32
    2 Votes
    32 Posts
    25k Views
    ThosRTannerT

    Just a quick question - when will the plugintemplate repo be updated to include the new message?

    Thanks

  • New NppESPHome plugin

    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • Which lang other then c/cpp to build plugins

    4
    0 Votes
    4 Posts
    54 Views
    EkopalypseE

    @h-jangra

    Be careful when using V, as it has made some decisions, such as removing the option for users to create a dllmain, that are… strange. In addition, at least during the time I worked with V, there were repeated problems with the various compilers.
    Gcc did this, but msvc did not, clang always caused problems, especially in release mode, and tcc does not work at all in this area. Don’t get me wrong, you can get them all to work, but you’ll end up spending more time working around the obstacles than working on the plugin, and unfortunately, there is no win32 library yet. So you have to write every Win32 function you use yourself and hope that it doesn’t conflict with the ones V uses internally.
    So if you want to use a new language, I would recommend Rust, C#, Delphi, Odin, or Zig.
    With the exception of Delphi, I created plugins in all the other languages for testing and ultimately decided on Rust for the LSP client plugin.

  • Inline markdown preview & better note taking plugin idea

    5
    0 Votes
    5 Posts
    364 Views
    EkopalypseE

    @h-jangra

    I doubt that you can implement this in Scintilla in a reasonable way, but the other idea of having a preview is there, and there are at least two plugins, here and here that can give you some ideas.

  • possible to create a openfile dialog under jn-npp-plugin ?

    5
    0 Votes
    5 Posts
    479 Views
    C

    after a look at jn-npp-plugin on github it seems Win32 API is not available in win x64 and i didn’t find other way to use openfiledialog…
    i am looking at python plugin now .

    thanks for your help

  • Scripts to align text

    4
    4 Votes
    4 Posts
    2k Views
    sound-fxS

    The following code supports PythonScript 3.0.23 as well as earlier versions of PythonScript 3.x.

    #------------------------------------------------------------------------ # If the character specified in the current selection is a white space, # then prompt the user to enter the alignment character (or characters), # using this character as the initial default. #------------------------------------------------------------------------ default_align_char = ',' from enum import Enum class PaddingSide(Enum): LEFT = 0 RIGHT = 1 def align_selected_text(max_align_char_count = None, padding_side = PaddingSide.LEFT): """Insert padding into the lines in the selection, as needed, to align up to max_align_char_count instances of a specific character or string of characters The default is to align all instances of the specific character. At present, the alignment character is taken as the character at the top of the current selection. You can uncomment some code below to change this policy to instead take the alignment character from within the selection at whichever end has the cursor. Either way, if that character is white space, the user is prompted to type the character (or characters). If you really wish to align on a white space character, you can just click OK at the prompt. When prompted to type the alignment character, the user may enter a sequence of characters, e.g., "-->", in which case the alignment is on the instances of that entire character sequence. For example, if the user enters "-->" at the prompt, then instances of the "-" character get aligned only if they're followed immediately by the characters "->", while instances of, say, "-1" and "- " remain unaltered. If there is no current selection, then aligns all lines in the editor. If there is a current selection, then aligns only the lines that are at least partially included in the selection, and the selection is changed to the entire block of newly-padded lines. Parameters ---------- max_align_char_count : positive integer, optional The maximum number of instances to align of the specific character. For example, set to 1 to align only the first instance of the character on each line. The default is to align all instances of the specific character. """ from Npp import editor #---------------------------------------------------------------------------- # For the alignment character, take the character just inside the bounds of # the selection block (at either the start or the end, as determined below). #---------------------------------------------------------------------------- editor.targetFromSelection() selected_text = editor.getTargetText() # Use this code to get the align_char unconditionally from the start # of the selection. align_char = selected_text[0] # Optionally use this code to get the align_char from within the selection # at whichever end has the cursor. # (startByte, endByte) = editor.getUserCharSelection() # if startByte == editor.getCurrentPos(): # align_char = selected_text[0] # else: # align_char = selected_text[-1] # If the character from the selection seems implausible as the # align_char, then prompt the user for it. if align_char.isspace(): from Npp import notepad global default_align_char align_char = notepad.prompt('Align character:', 'Enter Alignment Character', default_align_char) if align_char is not None: default_align_char = align_char #---------------------------------------------------------------------------- #%% Get the lines of text within the selected alignment block #---------------------------------------------------------------------------- (startLine, endLine) = editor.getUserLineSelection() startPos = editor.positionFromLine(startLine) endPos = editor.getLineEndPosition(endLine) text_lines = editor.getTextRangeFull(startPos, endPos).splitlines(True) #---------------------------------------------------------------------------- # Remember whether there is a user-selected block, so we can restore a # corresponding selection after aligning the text. #---------------------------------------------------------------------------- restore_selection = editor.getSelectionStart() != editor.getSelectionEnd() #---------------------------------------------------------------------------- # Align all instances of align_char within the lines of text #---------------------------------------------------------------------------- if align_char is not None: # Enable the following to save the align_char, however it was determined, # to be the default_align_char when prompting for it next time. # default_align_char = align_char padding_side_offset = padding_side.value * len(align_char) if max_align_char_count is None: align_char_count = max(line.count(align_char) for line in text_lines) else: align_char_count = max_align_char_count start = 0 for instance in range(align_char_count): # Set the target column using the index of the align_char, ignoring # immediately preceding space, or the length of the line tgt_char_col = max(len(line[:line.find(align_char, start)].rstrip()) for line in text_lines) for (idx,line) in enumerate(text_lines): align_char_col = line.find(align_char, start) if align_char_col >= 0: text_lines[idx] = line[:align_char_col+padding_side_offset].rstrip().ljust(tgt_char_col) \ + line[align_char_col+padding_side_offset:] start = tgt_char_col + len(align_char) editor.setTarget(startPos, endPos) editor.replaceTarget(''.join(text_lines)) if restore_selection: startPos = editor.positionFromLine(startLine) endPos = editor.getLineEndPosition(endLine) editor.setSelectionStart(startPos) editor.setSelectionEnd(endPos) if __name__ == '__main__': align_selected_text()
  • NppVim 1.6.0.0 Release - what's next macros?

    1
    3 Votes
    1 Posts
    88 Views
    No one has replied
  • Support for Plugins Admin & NppPluginList

    74
    1 Votes
    74 Posts
    122k Views
    pbarneyP

    Would it be possible to add a column (or two) to the Plugins Admin? Created and Last Updated sortable columns to be able to find the most recent plugins.

    It would also be wonderful to have another column Description that just gives the first line of the longer description that is displayed in the lower box when you click on a plugin.

  • Compose for Notepad++ (another experimental plugin)

    16
    8 Votes
    16 Posts
    1k Views
    CoisesC

    In case anyone is interested, I’ve created a version of this that runs as a Windows application rather than as a Notepad++ plugin, so it works in all applications:

    Compose for Windows

    This should be considered experimental. Since it works everywhere, not just in Notepad++, it has more potential to mess things up if I’ve missed something.

    Since it has no connection to Notepad++ (other than being a spin-off of the plugin described in the original topic message):

    The convenience features for editing a user definitions file which I added in response to @PeterJones’ notes aren’t included.

    Further discussion will be off-topic here. Please raise questions and concerns in the Issues for the project.

    The actions to create GitHub pages are, for some reason and at least temporarily, not working on this repository, which affects the normal presentation of the help file. However, you can still read the help file here (though some links appear to be garbled).

  • Markdown preview plugin

    3
    0 Votes
    3 Posts
    223 Views
    PeterJonesP

    @notdodgeball said,

    If you are talking the MarkdownViewerPlusPlus plugin by nea, its indeed been dormant for many years, although I suspect it still works and you may have a problem on your end.

    I can confirm MarkdownViewer++ still works… in that I still semi-actively use it in Notepad++ v8.8.7-64bit (it’d been a few weeks since the last time, so in case I had misremembered and it was on v8.8.5 that I’d last used it, I double-checked today, and it can still display my Markdown)

    @Dragon-Red said,

    Do you plan to upgrade the DLL so that this plugin is usable again?

    In case you were curious, this Community Forum is the Community of Notepad++ users. Further, plugins are maintained by their respective authors or maintainers, not by the Notepad++ Developer, so even if you incorrectly thought this Community was the way to get in contact with the Notepad++ Developer, he’s not the right one to contact when you want an fix for a plugin. (And, as @notdodgeball told you, MarkdownViewer++ is effectively unmaintained at this point, unfortunately.)

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

    5
    0 Votes
    5 Posts
    451 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
    84 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
    2k 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
    177 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
    480 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
    234 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
    21k 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
    236 Views
    No one has replied