Community
    • Login

    File not entirely highlighted after NppMsg.NPPM_DOOPEN

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    5 Posts 2 Posters 4.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sanastasiouS
      sanastasiou
      last edited by sanastasiou

      Hi all,

      in my plugin, I have implemented reference linking for a DSL. Just like when you click ctrl+click in Visual Studio. All works well except the fact, that some larger files are not completely highlighted. This is the function in question:

          public void OpenFile(string file)
          {
              IntPtr sci = Plugin.nppData._nppHandle;
              _win32.ISendMessage(sci, NppMsg.NPPM_DOOPEN, 0, file);
          }
      

      Pretty straightforward stuff. Problem is, that this happens:

      Screen size

      Below screen size

      The first picture is the the whole screen, but under that it appears that the scintilla part didn’t complete going through the document.

      Is there some way to “force” a redraw or something?

      P.S. this never happens when I open a file normally, just when using NPPM_DOOPEN.

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • sanastasiouS
        sanastasiou
        last edited by

        If I programatically write anything to the buffer, then it get’s correctly highlighted. I can reproduce this with 100% success. However not sure if it’s a NPP bug or Scintilla bug. In particular I don’t understand why opening a file from the menu works always, do NPPM_DOOPEN do anything else?

        1 Reply Last reply Reply Quote 0
        • dailD
          dail
          last edited by

          That’s weird. Is that a User Defined Language? If so does N++ also have this bug if it uses one of its built in languages?

          1 Reply Last reply Reply Quote 0
          • sanastasiouS
            sanastasiou
            last edited by

            Hallo @dail sorry was busy with real life debugging :)

            Yes, it is a DSL and I am providing a lexer for it and a whole plugin as well. I believe the bug is not NPP related, rather plugin related. I am “swallowing” some events while this is happening, namely some keystrokes. I have no clue, as to why this is affecting the syntax highlighting procedure.

            If I find this out, I’ll post the findings here.

            1 Reply Last reply Reply Quote 0
            • sanastasiouS
              sanastasiou
              last edited by

              @dail Problem is fixed - I believe it had to do with false implementation of folding… In any case I cannot reproduce this anymore, so I think it’s plugin specific.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors