• Plugin Exception Handling c#

    3
    2 Votes
    3 Posts
    368 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
    236 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
    707 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
    853 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
    288 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
    2k Views
    xb zhouX

    @Alan-Kilborn Thank you!

  • [New Plugin] Biotools

    7
    5 Votes
    7 Posts
    588 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
    723 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.

  • Converting a Macro into a plugin

    5
    1 Votes
    5 Posts
    410 Views
    PeterJonesP

    @Jerome-Evans said in Converting a Macro into a plugin:

    I would like to make it into a plugin so more people can use it

    As another alternative to either “plugin” or “PythonScript”, if you just copy the <Macro ...>...</Macro> element from your shortcuts.xml file and paste it in the forum, and other people can just use your macro (or customize it to their liking)

    For formatting the XML excerpt, select your pasted macro and use the </> button, or manually put ``` on the line before and after in your post, like:

    ``` <Macro name=...> <Action ... /> ... </Macro> ```
  • [New IDE] NPP MSVC C++ IDE

    3
    1 Votes
    3 Posts
    461 Views
    NT FiveN

    Looks like a great solution.
    However, setting this thing up is so convoluded that just reading the instructions makes my head spin, so I won’t even bother.

  • Columns++ missing features / road map

    15
    1 Votes
    15 Posts
    1k Views
    CoisesC

    I´ve published a new release, Columns++ v1.0, which can check GitHub for new releases.

    The user can choose (in the Options dialog) to show a notice for all new releases or only for new “stable” releases, or to turn off automatic checking. The notice is displayed by adding “Update Available” to the text of the “Help/About” item at the bottom of the Columns++ menu. The automatic check occurs when Notepad++ loads Columns++ and is limited to once every twelve hours. The default is to show a notice only for new stable releases, which are releases not marked as a Pre-Release on GitHub.

    It is also possible to check on demand from the Help/About dialog, which shows links to the newest and latest stable releases on GitHub.

    I’ve submitted a pull request to add this to the Plugins Admin list.

    There is still only the Quick Installer or manual copying to install a release that isn’t offered by Plugins Admin. It’s not ideal, but it’s simple and probably works for most people.

  • 1 Votes
    3 Posts
    467 Views
    PeterJonesP

    @Prof-Ezequiel-Soares ,

    adding support for a language widely used in teaching programming: VisuAlg. How can I proceed to send the import file?

    It depends on what you mean.

    If you mean, “I wrote a User Defined Language (UDL) definition for VisuAlg”, then you can submit it to the UDL Collection – it wouldn’t be distributed with Notepad++ (because other than Markdown, UDLs do not get distributed with Notepad++), but that’s the official location to publicly share UDL definitions.

    If you mean, “I wrote a lexer plugin to parse VisuAlg”, then you can submit it to the Notepad++ Plugin List repo, and on the next release of Notepad++, your VisuAlg Lexer Plugin would be listed in Plugins Admin so that people can download it.

    If you mean, “I wrote a Lexilla lexer I want to have included with Notepad++”, then you would submit it to the Lexilla project, and if they decided to included it, then the next time Notepad++ updates its Lexilla instance from the Lexilla project, it would be included.

    If you mean, “How do I develop a UDL, so that I can then share it per the first point above”, then see https://npp-user-manual.org/docs/user-defined-language-system/

    If you mean, “How do I develop a lexer Plugin, so that I can then share it per the second point above”, then see https://npp-user-manual.org/docs/plugins/#building-a-lexer-plugin

    If you mean, “How do I develop a new lexer for Lexilla, so that I can share it per the third point above”, then you’ll have to go to the Lexilla project to find out if they have instructions or FAQs or suggestions for how to do that, because they are a separate, independent project from us.

    If you mean, “I thought that someone else might have already written one, and I just wanted to download it and use it, I wasn’t offering to do all that work”, then I think you’re out of luck, because such a UDL or Lexer hasn’t yet been submitted to any of those locations.

    Good luck.

  • When you print a document you don't see the preview

    6
    1 Votes
    6 Posts
    13k Views
    Alan KilbornA

    @mkupper said in When you print a document you don't see the preview:

    for my printer that a printed page from Notepad++ is 67 lines and that it can have up to 94 characters per line

    Interesting.

    I’d think that if someone used a pdf printer to “preview” a Notepad++ document print, wouldn’t they just then print the pdf (and thus get what they saw in the “preview”)…

  • Cannot install plugins at all

    34
    1 Votes
    34 Posts
    56k Views
    mkupperM

    @Kang-Tri Firewalls rarely get in the way of plugins. Disabling them as a general practice in an attempt to solve a problem that someone can’t articulate well is bad advice.

  • plugin template, docking feature, and c++ core guidelines

    7
    2 Votes
    7 Posts
    616 Views
    rdipardoR

    The essential point to remember is that the every facet of the API surface is C-compatible, just like the Win32 API, which underlies all of N++'s internal functions. The details of how N++ dispatches plugin messages naturally involves a few C++ semantics, because it’s a C++ application. Plugins can implement their own C++ types, too, but nothing in the API says they have to. If you just want to display a free-floating form, you can use whatever functions your plugin natively supports, from ::CreateDialogParam to System.Windows.Forms.Form.ShowDialog.

    The (poorly documented) purpose of the docking API is to register a form with the Docking Manager. In practice, that means preserving the form’s position and geometry in config.xml, so that N++ can optionally reload it when the application starts. To do that, a plugin sends NPPM_DMMREGASDCKDLG with a pointer to a C-like structure filled with some basic parameters, as shown in the developers’ manual.

    The form’s creation is entirely up to the plugin. N++ simply invokes the function that creates the form by calling through a function pointer. No plugin is required to instantiate a DockingCont or any other object derived from a C++ class. Examples of plugins that do this anyway are special cases, not illustrations of how the docking API works.

  • How to connect Netezza with notepad++

    3
    -2 Votes
    3 Posts
    325 Views
    mkupperM

    @Udhaya-Bharathi-Kumar

    You wrote “How to connect NZ with notepad++.” Notepad++ is normally the client application and would connect with a server. NZ is normally a server that you connect to using clients. You want to do this backwards. Is your desire to control and use Notepad++ using NZ scripts?

    For me, step-by-step starts out with defining what it is that I want to do. I usually start out using pencil on paper to make drawing of a high level overview and then fill the gaps and details. Once I have a general idea of the goal I code up a simple user interface that’s mainly there to run test/debugging of the next phase which is the bottom layer details which I fully write and debug. I usually learn a lot about exceptions and oddities while coding the bottom later that needs to be taken into account when the middle or upper layers get structured.

    See bottom–up and top–down design on Wikipedia. I’m doing both top down and bottom up but with an emphasis on bottom up. I leave the middle layer that glues the top and bottom for last.

  • New Plugin: All Occurrence Selector

    1
    3 Votes
    1 Posts
    450 Views
    No one has replied
  • Save Plugin Button State

    3
    0 Votes
    3 Posts
    424 Views
    rdipardoR

    I said in Save Plugin Button State:

    If a certain plugin is not using it (or using it wrongly), that’s an issue for the plugin’s maintainer to resolve.

    The bug report is here, finally: https://github.com/nea/MarkdownViewerPlusPlus/issues/159

    In the meantime, just putting .dll after the plugin name will get it working, e.g.,

    <!-- <GUIConfig name="DockingManager" ... > --> <PluginDlg pluginName="MarkdownViewer++.dll" id="0" curr="1" prev="-1" isVisible="yes" /> <!-- </GUIConfig> -->
  • [Plugin update] Npp-Reverse-Text (32bit ported to 64bit)

    1
    2 Votes
    1 Posts
    334 Views
    No one has replied