Notepad++ Plugin GetText Method Not Getting Entire String In C#
Good evening, We have this Notepad++ Plugin project that will read and parse an html document converted from a MS Word file and then change the html string into an Adobe In Design format. The issue is that the html document has over 20,000 plus lines even reaching 40,000 lines or more. The code below will get all the text from an active Notepad++ window but fails if the string content is huge. public unsafe string GetText( int length) { byte [] textBuffer = new byte [10000]; fixed ( byte * textPtr = textBuffer) { Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, (IntPtr)length, (IntPtr)textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd( '\0' ); } } After doing some debugging and troubleshooting, I found a solution that is to replace the size of the textBuffer variable from a static value 10000 to the actual length passed into the function parameter. public unsafe string GetText( int length) { byte [] textBuffer = new byte [length]; fix