How can i get a specific deserialized code in npp++ to c#



  • Hi , I’m writing a plugin with C#. The plugin deserializing data from a server(data is a script and it includes code , id , name etc.) and puts data to notepad++ file. I have to select this data’s code part from the file and serialize it again and patch it back to server, after editing the code . My problem is i dont know how to select the part i wanted ?
    GetScript1.PNG

    GetScriptCode.PNG

    e.g Plugin have to select function automatically after I edited the code

    PatchCodePart1.PNG

    PatchCodePart2.PNG

    This is the part that i have to write selecting and patching codes



  • @Yunus-Emre-Kütükçü
    I’m not sure I understand this correctly. Do you mean the entire content?
    If so, then SCI_GETTEXT is the way to go.
    If you want to have only the part that contains the changed lines, then you
    you have to work with markers.
    Find them, find the start and end position of that line and use SCI_GETRANGEPOINTER to retrieve the text.

    I don’t know if this is relevant in your case, but make sure you consider text encoding.


Log in to reply