• 4 Votes
    7 Posts
    814 Views
    CoisesC

    @rdipardo said in Generalized fix for Ctrl+C/X woes in C# plugins (beginning in Notepad++ 8.6.1):

    Don Ho obviously took for granted that every plugin would be developed on the same toolchain as the host application. And C++ developers have mostly vindicated that assumption by using Microsoft’s Visual C++ compiler almost exclusively. Plugins built with GCC are even harder to find than non-C++ ones.

    I don’t draw the same conclusion. It’s possible that I’ve missed something, but as far as I can tell, the plugin interface is strictly C (not C++) and Win32 API. That is as close to generic as you can get under Windows.

    Were the interface C++, a GCC plugin probably wouldn’t work. The C ABI is compatible across compilers (and languages); C++ ABIs are not. (They’re not even guaranteed to be compatible between different versions of the same compiler, though generally compiler vendors try really hard not to break things in that way.)

    When writing in C++ for Windows only and using the Win32 API, Visual Studio with MSVC is simply the path of least resistance. Unless you have another tool chain already set up, or additional requirements, there is little reason to use GCC, so I’m not surprised it isn’t frequently done. There’s no reason it can’t be done, it’s just extra hassle for no benefit.

    I suspect the problem for C# plugins is, strictly speaking, WinForms and not C# itself. WinForms was probably not meant to interoperate with unmanaged Win32 API windows in the same application (especially with Win32 handling the top level windows and the message loop).

    If that’s the problem, and if the creators and maintainers of C#/WinForms have not specified any mechanism by which this can be reliably accomplished, then there’s little anyone can do about it except hack around and hope, or refrain from trying to use C#/WinForms for something it is not meant to do.

  • Problems identifying number of open files

    8
    0 Votes
    8 Posts
    510 Views
    Andi KiisselA

    I needed the number of open tabs in NppExec script, and I found this way:

    npp_sendmsg NPPM_GETNBOPENFILES 0 0 // = total, may be wrong +1 set local n ~ $(MSG_RESULT) npp_sendmsg NPPM_GETCURRENTDOCINDEX 0 0 // MainView, returns -1 if view is closed set local n ~ $(n) - ($(MSG_RESULT)<0) npp_sendmsg NPPM_GETCURRENTDOCINDEX 0 1 // SubView, returns -1 if view is closed set local n ~ $(n) - ($(MSG_RESULT)<0) echo $(n) // = right number of open tabs

    If somebody knows simpler method, it’s very welcome.

  • Visual Studio Code C# - Error MSB4062

    8
    0 Votes
    8 Posts
    823 Views
    Skycc LimS

    @DGutierrez3
    i face the exact same issue you mention on top when i migrate my development environment to new PC with fresh intallation of visual studio. 1st i thought would be due to newer version of visual studio but its not.

    later on i found the solution for this, not sure if you still need it, keep a record here in case anyone else face the same issue.

    Solution:
    this was due to missing .net framework 3.5, just need to manually install .net framework 3.5 solve my compilation issue. Guess .net 3.5 only come with VS 2015 or older, VS 2017 onwards come with newer .net framework

  • Looking for issues to contribute

    11
    3 Votes
    11 Posts
    718 Views
    Lycan ThropeL

    @miro-penchev ,
    Sadly, @Alan-Kilborn is right, as I have on my older desktop computers the old keyboards with 124 keys, and always appreciated the extra spots for putting my own macros etc, so this would be a feature that interested me, but as @Alan-Kilborn points out, this is a niche use case, and finding a desirable number of people to test it, let alone NEED it, isn’t a compelling issue, since most people using those kinds of keyboard may very well be able to write their own macros for those keys to do what they want. I don’t have access to them right now to test that theory, but the argument still holds, that it’s not a common enough keyboard to warrant an application wide need to change it.

  • Calltip On Space 1.0 (PythonScript)

    3
    3 Votes
    3 Posts
    313 Views
    Khundian TwitchK

    I’ve put the file on Github, will be better compared to a forum post to keep track in case of updates.

    Link

  • 1 Votes
    7 Posts
    823 Views
    Mark OlsonM

    @Coises
    @rdipardo

    Thank you both for your suggestions! I meant to respond sooner, but there was a power outage.

    In any case, Coises’ original suggestion worked! Thank you so much! I already knew that I had to disable GenericTabNavigationHandler, so all I did was go into the Designer.cs files for all of my forms and rearrange the order in which they were added to their parent and it just worked.

    Hand-editing Designer.cs files is kind of a no-no, because they’re automatically generated by Visual Studio when you edit a form in the designer, but I’ll happily take this solution over whatever lousy alternative I was going to use.

  • [New Plugin] LuaScript

    29
    4 Votes
    29 Posts
    68k Views
    mpheathM

    @MaximilianKohler Do a simple test to debug.

    startup.lua:

    -- Startup script -- Changes will take effect once Notepad++ is restarted print('Hello World')

    Console:

    Hello World Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

    With the PortableApps distribution of Notepad++, If you install a plugin and Notepad++ restarts then the environmental variables related to PortableApps are not set from that instance of Notepad++. You need to close that instance and start a new instance using Notepad++Portable.exe to have those environmental variables set. You can check by running CMD and use the command set from Notepad++ to see all the extra environmental variables that are added or values being modified.

  • 0 Votes
    3 Posts
    294 Views
    Lycan ThropeL

    @А-А ,
    In addition to what @PeterJones has mentioned, there is also a quirk with the functionList that requires you to add I believe 2 carriage returns at the end of a file, to make it ‘see’ the last functions in a file. I found this to be the case recently when I was checking some code I had been fixing and noticed that one of the functions I was looking for was missing at the end of the file, and I remembered the bug, added two carriage return/line feeds, and it became visible. Read the FAQ for the FunctionList Basics where @MAPJe71 documents some of the bugs with the FunctionList.

  • Looking for Text Masking Logic in N++

    3
    1 Votes
    3 Posts
    591 Views
    Thomas KnoefelT

    @Ekopalypse said in Looking for Text Masking Logic in N++:

    I’m not sure, but I assume you are looking for TinyXML .

    Yes, this was the part i was looking for. PutString is translating the special characters. This helps me a lot! Thanks!

  • Default rtl mode

    5
    0 Votes
    5 Posts
    452 Views
    FNActivityF

    @PeterJones
    @Paul-Baker
    Thanks for the reply, I didn’t have access to the internet for a while, and now that I’m back, I found out that Notepad has completely fixed this problem in the new update, and that’s great.

  • 0 Votes
    4 Posts
    491 Views
    Paul BakerP

    @Paul-Baker

    The c# template I am using had these already defined… Not sure how I missed this. But thanks again!

    /// <summary>Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043)</summary> int MarkerAdd(int line, int markerNumber); /// <summary>Delete a marker from a line. (Scintilla feature 2044)</summary> void MarkerDelete(int line, int markerNumber); /// <summary>Delete all markers with a particular number from all lines. (Scintilla feature 2045)</summary> void MarkerDeleteAll(int markerNumber); /// <summary>Get a bit mask of all the markers set on a line. (Scintilla feature 2046)</summary> int MarkerGet(int line);
  • NppExec v0.8.8 has been released!

    1
    4 Votes
    1 Posts
    559 Views
    No one has replied
  • How to Set Lexer Language after OpenFile

    10
    0 Votes
    10 Posts
    790 Views
    rdipardoR

    @Paul-Baker said in How to Set Lexer Language after OpenFile:

    if you switch tabs and then switch back . . .

    The NPPN_READONLYCHANGED notification exists for use cases like that.

  • How to create a C# plugin that uses a non-dockable dialog

    16
    0 Votes
    16 Posts
    869 Views
    Paul BakerP

    @Mark-Olson said in How to create a C# plugin that uses a non-dockable dialog:

    One other warning I have about the plugin pack that you should be aware of…

    There are a lot of methods (29 by my count) in the ScintillaGateway.cs that look something like this:

    Thanks Mark. I’m still chewing on the dialog. The JSon Tools plugin is displaying a Settings input dialog which is what I want to do. I’ll be on the lookout for the unsafe methods and apply your recommendations as needed, I appreciate your comments. Thank you!

  • Toolbar Icon not appearing

    5
    0 Votes
    5 Posts
    485 Views
    Thomas KnoefelT

    @PeterJones said in Toolbar Icon not appearing:

    needs to match with the command number in your setCommand for that menu entry

    Ok, that makes now absolute sense for me. My setCommand is actually pointing to 0 to call the plugin.

  • New C# plugin template

    1
    3 Votes
    1 Posts
    1k Views
    No one has replied
  • Changing whether a toolbar icon is highlighted

    3
    0 Votes
    3 Posts
    263 Views
    Mark OlsonM

    @rdipardo said in Changing whether a toolbar icon is highlighted:

    NPPM_SETMENUITEMCHECK

    Agree that that works to check the menu item in the plugin menu, but it doesn’t do anything to the toolbar icon.

    I’ll just create an issue in my new C# plugin pack once I finally release it to GitHub, and maybe you can submit a PR.

  • Is there a SCI_SETLINE type message (How to update a line)

    19
    1 Votes
    19 Posts
    1k Views
    Alan KilbornA

    @Mark-Olson said in Is there a SCI_SETLINE type message (How to update a line):

    much faster if you just slurp all the text out in one go, process it in C#, and then dump it all back into the file

    …and watch your change-history go “all orange”, registering every character in the file as “changed”. Secondary concern: It also nullifies a plugin’s opportunity to provide step-by-step undo for possible individual modifications it makes.
    For me this would be a big problem, and I wouldn’t use a plugin that did this to me.
    Sure, for some people this would be absolutely no problem.
    But I wouldn’t make this approach a general recommendation.

  • Notepad++ v8.6.2: Fix Ctrl-V not working for some plugins

    1
    4 Votes
    1 Posts
    698 Views
    No one has replied
  • Feature Request: Colourized Tabs based on Folder Path. Please

    7
    1 Votes
    7 Posts
    677 Views
    Alan KilbornA

    @innoovative-thiinking said in Feature Request: Colourized Tabs based on Folder Path. Please:

    looks like manual colorization and drag dropping is the way to go forth.

    If I were you, I would not expect to see this behavior added to Notepad++, but, you never know.
    Good luck.