File not entirely highlighted after NppMsg.NPPM_DOOPEN

  • 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?

  • 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?

  • 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?

  • 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.

  • @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.

Log in to reply