nea / MarkdownViewerPlusPlus

A Notepad++ Plugin to view a Markdown file rendered on-the-fly
MIT License
1.17k stars 143 forks source link

Notepad++ crashes when editing *.md in realtime #69

Closed dvdvideo1234 closed 5 years ago

dvdvideo1234 commented 6 years ago

Issue description

  1. Download this
  2. Replace all the three backticked tokens with \n
  3. Click the MD icon in NPP
  4. Strech the window on the two extended monitors \ and the NPP docking to be on the left monitor and \ MD to be on the half of the right monitor surface
  5. Type something reasonably fast like 3-4 letters a second

Markdown to reproduce

I think this is pretty self explanatory

Screenshot

code_editor

Environment

I have to add more stuff to this file so this is kinda blocking for me, though am not a rush to fix it.

nea commented 6 years ago

Hi @dvdvideo1234

Have you tried updating the plugin to release 0.8.1 https://github.com/nea/MarkdownViewerPlusPlus/releases/tag/0.8.1?

What do you mean by: "Replace all the three backticked tokens with \n"

And regarding the fast typing: Yeah, I know. At the moment every change triggers a redraw. In your case a redraw of a pretty big document with large images. I am still working on adding a delay to this to counter quick typing in one of the next releases. Another thing would be to have images disabled. Never thought about that.

Thanks

dvdvideo1234 commented 6 years ago

Have you tried updating the plugin to release 0.8.1

So far I did not, the plugin manager shows that it has no updates pending

What do you mean by: "Replace all the three backticked tokens with \n"

Open the file via Npp:

  1. Select ```
  2. Ctrl-R
  3. Click the Extended checkbox on the search options
  4. In the Replace with write \n
  5. Click Replace all

So far crashes when it is maximized on the left and right monitor. When it is not maximized, it is rather more sturdy when processing the MD. Is it that the file is too big and the rendering it taking more time than the the time between characters are written. It does not crash when I write like 1 char a second ..

nea commented 6 years ago

Hey @dvdvideo1234

Ok, does not crash for me. Really seems to be the load in redrawing. Thanks for the big example document, so I can check with this use-case furthermore to identify what to do.

Until then... sorry ^^'

dvdvideo1234 commented 6 years ago

Np. ;) The document is not critical for me, but some people are having trouble reading it, because I gotta put quite a lot of stuff in there to explain everything in my code, so some suggested that I should at least put # headers to break it apart. Apparently that way is far more stable when editing in NPP. \ Is it going to be better if the re-drawing is like synced in half of a second for example and triggered IFF a flag is present and key is pressed ? Something like pseudo OOP code in C++ :

// Initialize the timer to raise a pulse every cycle `Example: half a second`:
TIMER_t TIMER = cTimer(0.5);   // A timer generating 0.5s (configuration controlled)
BUFFER_t BUFFER = cBuffer(""); // A buffer storing what the user types
MARKDOWN_t MARKDOWN;           // A markdown rendering instance
DRAWF_t *MDF;                  // A markdown draw frame instance pointer

if(TIMER.isReset())
  // Timer RESET has arrived. Half a second has passed. A pulse is generated
  TIMER.clearReset(); // Clear the flag
  MDF = MARKDOWN->getFrame();
  if(strcmp(BUFFER.getKeyPress(), "") ~= 0 && !MDF->isRendering())
  {  // If there are pressed keys in the buffer by the user
    BUFFER.clear();
    MDF->Draw();
  }
}
dvdvideo1234 commented 6 years ago

Here is the error, the information, .NET stuff and WER crashlog Report.wer about it extracted from the windows event viewer. I know it's not much, but it might help ;)

dvdvideo1234 commented 6 years ago

Hello,

I found a workaround for my problem, which I used to update the document. I switched off the markdown viewer, made my edits and toggled a preview. For now the preview does not show the full document, but rather renders it to here, where sub-point 2 is the last rendered data and sub-point 3 is not rendered. The information equal and later than this is not rendered at all. I assume that there is an option which saves the buffer from overflow and prevents the rendering over the other half of the document.

Cheers !

dvdvideo1234 commented 5 years ago

I've relocated the markdown readme to the github Wiki. Problem solved :smile_cat: