• Resources/Tutorial for Next Steps in Plugin Development?

    5
    0 Votes
    5 Posts
    1k Views
    Mark OlsonM

    This doesn’t exactly solve your problems with the C++ template, but…

    I (along with several others) have made plugins with C#, rather than C++. The plugin template all the aforementioned plugins is here.

    You can stop reading here if you dislike sales pitches for programming languages.

    Reasons why I think using C# instead of C++ is a good idea:

    Windows Forms Visual Studio has a GUI so you don’t need to edit special config files to edit your forms Powerful controls like the TreeView (a huge help in the development of my JsonTools plugin) I find the event-and-subscriber-based system for handling events like clicking on the controls to be very intuitive Windows Forms have a lot of events defined, making it easy to respond to lots of types of user actions C# has nice productivity features and a garbage collector. C# is really fast. Seriously, though. I have definitely noticed plugins written in C# that perform X task faster than a comparable plugin implemented in C++.
  • Columns++ recommended update to 1.0.2

    4
    3 Votes
    4 Posts
    628 Views
    CoisesC

    @M-Andre-Z-Eckenrode said in Columns++ recommended update to 1.0.2:

    VirusTotal appears to confirm the presence of one or more threats

    This is a frustrating situation for me, and I don’t know that there is much I can do about it.

    I can promise you that there is no malware in the releases I’ve posted on GitHub, but you don’t know me.

    The just-released version of Notepad++ includes Columns++ in Plugins Admin, but I fixed a serious error after the version that will be included, so the fix won’t be included until the next time Notepad++ is updated.

    I suspect the Quick Installer gets flagged because I used a very simple method to package a script to update the plugin files — something that’s probably done by malware more often than legitimate software. I might be able to fix that, but it will take time.

    I’m not sure why the x86.zip file is flagged. I see just 2 of 61 vendors flagging it. (The x64 file contains exactly the same code, compiled for 64-bit execution, and 1 of 61 vendors flags it.) There is no way for an independent developer to find out why it is flagged. (Understandably, telling programmers how malware is detected would be telling malware authors how to avoid detection.)

    The situation may have gotten worse because I included logic to check for new versions, out of concern for exactly the situation that has occurred — finding a serious error too late to have the version with the fix included in the next Notepad++ plugins admin.

    I’m sorry that I have no better advice than this to give:

    You can trust me and bypass the malware warnings (if your system isn’t configured to deny you that option).

    You can compile from source. (Not likely to be practical unless you are a developer yourself and already have Visual Studio set up on your computer.)

    You can use the version available through the Plugins Admin in Notepad 8.6.1 and be careful not to use Replace All/Before/After if you have any unsaved data in any tabs, because there is a condition in which it will hang and necessitate force-closing Notepad++.

    You can wait until some future version of Notepad++ happens to release with the Plugins Admin containing version of Columns++ in which I haven’t made a serious blunder.

    I truly hate this. I’m already disgusted with myself for having made such a serious error, but that I can’t fix it without telling people to ignore their malware scanners and just install anyway is maddening.

  • Additional features to notepad++ workspace menu

    7
    0 Votes
    7 Posts
    2k Views
    Michael VincentM

    @DanielAzzam said in Additional features to notepad++ workspace menu:

    Can’t wait until files and folders are unified. :) as this will exactly what I was trying to reach.

    Have a look now at the 1.8.2.29 version.

    Cheers.

  • To add a new line in a script after a specific line match in notepad ++

    3
    0 Votes
    3 Posts
    642 Views
    Mark OlsonM

    @Kaleem
    In the future, please try to wrap text blocks in ```

    See also here

  • Detecting N++ UI Language

    5
    0 Votes
    5 Posts
    1k Views
    Thomas KnoefelT

    @rdipardo
    Delphi is one of my favorites 😉 it reminds me of my first big project from the early 90s. I’ve even managed to save the code on my GitHub.

    Your MultiLanguage implementation indicates that keeping the language snippets in a flat structure should suffice. I also don’t see any additional value in complicating it with XML.

    Thanks for sharing!

  • Install button is greyed out?

    10
    0 Votes
    10 Posts
    6k Views
    Alan KilbornA

    clicking the entire line would auto check the box like other apps

    Probably the reason clicking the line works the way it does is so you can be shown info about the plugin before somewhat committing to it.

    Sure, it really isn’t committing to it (because if clicking the line also clicked the box, you could still manually uncheck the box), but…

  • JSON String Escape / Unescape

    8
    0 Votes
    8 Posts
    16k Views
    Mark OlsonM

    @Ilia-Nenashev
    You’re using an old version of JsonTools that doesn’t have it.
    Try installing the latest release.

    I’d also like to note that JsonTools has a very detailed and regularly updated Changelog, so in general you should always be able to see when a certain feature was added.

  • Help in producing a plugin for column markers

    2
    1 Votes
    2 Posts
    321 Views
    PeterJonesP

    @Pedro-Henrique-Sousa-da-Silva ,

    It sounds like you want to implement a bullet list or outline. You might want to read this discussion from the Fall, as there are relevant ideas.

    Other than that, you will need to start with the User Manual’s Plugin section for getting started with plugin development.

  • Scripts to align text

    3
    3 Votes
    3 Posts
    2k Views
    CoisesC

    For what it’s worth, the plugin Columns++ can also do this using the Align… menu option. Alignment can be on the first or last occurrence of a character or string, or on a regular expression.

  • New to plugin development - help needed.

    9
    1 Votes
    9 Posts
    1k Views
    K

    @Alan-Kilborn

    Thanks again. I am developing this on an old laptop and didn’t realize NPP was so old. Upgraded using the drop-in (portable) version on x64 and all is working. Now to review the docs and plan my logic.

    Keith Smith

  • ::EnableMenuItem "do noting" on fileclosed??

    3
    0 Votes
    3 Posts
    402 Views
    MarioRosiM

    @Coises
    DrawMenuBar has no effect.

  • Plugin Exception Handling c#

    3
    2 Votes
    3 Posts
    534 Views
    James PlahitkoJ

    My issue was two-fold. The try-catch syntax was basically correct. However, I was technically sloppy in visual studio allowing the exception type to auto-fill the ArgumentException type. The “divide by zero” exception was not being caught.

    The second issue was re-throwing the exception and Notepad was picking it up. In this case, I don’t want Notepad to react. Life is good now.

    Thank you Mark for your suggestions.

  • Early preview of my NPP LSP plugin.

    7
    4 Votes
    7 Posts
    2k Views
    Andre PessoaA

    To Derek-Brown: I’m not sure if this is the right place for this, but I’m experiencing a weird bug. I set the plugin to work with Python, using the .json you provided and the Jedi python server. The plugin correctly points my python code mistakes by showing a small annotation popup. That function is working fine. The problem is: if I type any LETTER in my code, npp crashes (when typing special characters or numbers it doesn’t crash. It only happens when I type letters). Maybe it has something to do with the fact that I live in Brazil and my keyboard uses a different layout?
    By the way, I’m using the latest version of notepad++ (v8.6 x64) and I just downloaded the plugin .DLL (x64) from the sourceforge link you provided (so I believe it’s the latest version for the plugin as well). Running it all on Windows 10 x64.

  • all nppFTP profiles (ftp logins) gone after this last update :(

    3
    0 Votes
    3 Posts
    349 Views
    voblaunsaneV

    uhhh, thanks, i did not even stop for a moment to consider that plug-ins must be updated manually.

    thank you

  • MarkdownViewer++ synchronized scrolling not working

    4
    1 Votes
    4 Posts
    1k Views
    rdipardoR

    @Jonathan-Sachs said in [MarkdownViewer++ synchronized

    I tried Markdown Panel. “Synchronize with caret” has no effect . . .

    That feature is still blocked by an open issue with the .NET plugin infrastructure, although nothing really prevents the plugin developer from patching it himself, as @Michael-Vincent has already demonstrated.

  • Enhance count of occurrences when finding

    5
    2 Votes
    5 Posts
    2k Views
    PeterJonesP

    @pepe-pepe said in Enhance count of occurrences when finding:

    I would also need this.

    We in the Community are fellow users. Telling us you want the feature won’t tell the developer that you want the feature.

    last year, @Alan-Kilborn linked to the still-open feature request here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11118

    if you want the developer to know that there are more people who want this feature, you need to add a comment in that open feature request.

  • C++-plugin, combobox-drop-down-list not display her items

    3
    0 Votes
    3 Posts
    416 Views
    MarioRosiM

    Hello Thomas,

    yes that was it.

    h have use the version 8.4.6, now i make update to 8.6 and now it works fine…

    best gregards
    Mario

  • How can I get the encoding of current document?

    7
    1 Votes
    7 Posts
    4k Views
    xb zhouX

    @Alan-Kilborn Thank you!

  • [New Plugin] Biotools

    7
    5 Votes
    7 Posts
    886 Views
    Michael VincentM

    @Alan-Kilborn said in [New Plugin] Biotools:

    scripting with Notepad++, but now that you do, you have another possible tool in the toolbox.

    @AlexWeinreb

    As @Alan-Kilborn says - if you think you need / want to add more features to the plugin, since you haven’t gone full bore down the C++ route implementing tons of features and it’s just a first release, now would be the time to take a look at PythonScript and see if that integration would be easier for you to add lots of other bio-tools features from the BioPython library.

    Cheers.

  • RFC: Track previous position

    9
    2 Votes
    9 Posts
    1k Views
    Michael VincentM

    @Ekopalypse said in RFC: Track previous position:

    I just install it via pip install tree-sitter and pip install tree-sitter-languages and of course use PS3 with the preferred local installation to access it.

    Much nicer. Modified script playground.py to work with that setup:

    import os import re from tree_sitter_languages import get_parser from Npp import editor, editor1, editor2, notepad, MENUCOMMAND, SCINTILLANOTIFICATION class TreeSitterPlayground(): """ Follow a `tree-sitter` parse output (in `editor2`) and highlight syntax (in `editor1`). """ def __init__(self): super().__init__() self._edCallbacks = { self._on_updateui: [ SCINTILLANOTIFICATION.UPDATEUI ] } self._cst = [] def _on_updateui(self, args): if notepad.getCurrentView() != 1: return if self.DEBUG: print(args) if args['hwndFrom'] != editor2.hwnd: return line = editor2.getCurLine() match = re.search(r'Node\stype\=(.*?)\,\sstart_point\=\((\d+)\,\s(\d+)\)\,\send_point\=\((\d+)\,\s(\d+)\)', line) if (match is None) or (len(match.groups()) != 5): return # nm = match.group(1) sl = int(match.group(2)) sc = int(match.group(3)) el = int(match.group(4)) ec = int(match.group(5)) if self.DEBUG: print(f"[{sl}, {sc}] - [{el}, {ec}]") editor1.gotoLine(sl) spos = editor1.findColumn(sl, sc) editor1.gotoLine(el) epos = editor1.findColumn(el, ec) editor1.setSelectionStart(spos) editor1.setSelectionEnd(epos) def _dump_tree(self, node, indent=0): self._cst.append(f"{' '*indent}{node}") if node.child_count > 0: for c in node.children: self._dump_tree(c, indent+1) def parse(self): """Parse the current file.""" self._cst = [] # file name, path, extension parsing full = notepad.getCurrentFilename() path, file = os.path.split(full) name, ext = os.path.splitext(file) # get file language type and adjust for Tree-Sitter parser names filetype = notepad.getLanguageName(notepad.getLangType()).lower() if filetype == 'c++': filetype = 'cpp' elif filetype == 'shell': filetype = 'bash' # parse the file try: tree = get_parser(filetype).parse(editor.getText().encode()) except: print(f"tree_sitter_languages `{filetype}' not found") return # recurse the CST, create the output string and put it in N++ self._dump_tree(tree.root_node) cst = '\n'.join(self._cst) notepad.new() editor.setText(cst) notepad.saveAs(f"{os.environ['TEMP']}/{name}.trs") # Make sure the CST is in view 1 and the source file is in view 0 if notepad.getCurrentView() == 0: notepad.menuCommand(MENUCOMMAND.VIEW_GOTO_ANOTHER_VIEW) else: notepad.open(full) notepad.menuCommand(MENUCOMMAND.VIEW_GOTO_ANOTHER_VIEW) notepad.open(f"{os.environ['TEMP']}/{name}.trs") def start(self): """Start the service""" for cb in self._edCallbacks: editor.callback(cb, self._edCallbacks[cb]) self._ENABLED = True def stop(self): """Stop the service""" for cb in self._edCallbacks: editor.clearCallbacks(cb) self._ENABLED = False if __name__ == '__main__': try: isinstance(tsp, TreeSitterPlayground) print("Tree-Sitter Playground `tsp' already enabled") except NameError: tsp = TreeSitterPlayground() tsp.start() print("Tree-Sitter Playground instantiated as `tsp'") tsp.parse()

    Now, just open a file in Notepad++, run the “Plugins => Python Script => Scripts => playground” and it will try to parse the current file and setup the output CST (syntax tree) in view 1 and the source file in view 0 to allow scrolling through the CST and auto-highlighting the source in view 0 as per my screenshot in the previous post.

    Cheers.