Closed bkaradzic closed 5 years ago
There is bug here: https://github.com/juliettef/imgui_markdown/blob/d1726b1385f5790182892e41d4d8001a91fa0e04/imgui_markdown.h#L201
When widthLeft is too small to fit whole word endPrevLine doesn't advance and it causes infinite loop.
widthLeft
endPrevLine
My workaround was:
if (text == endPrevLine) { endPrevLine++; }
Other minor issues:
This: https://github.com/juliettef/imgui_markdown/blob/d1726b1385f5790182892e41d4d8001a91fa0e04/imgui_markdown.h#L155
Should be (fixes clang error): HeadingFormat headingFormats[ NUMHEADINGS ] = { { NULL, true }, { NULL, true }, { NULL, true } };
HeadingFormat headingFormats[ NUMHEADINGS ] = { { NULL, true }, { NULL, true }, { NULL, true } };
Also I would suggest to create .h file that contains only definitions users should use. I did this inside bgfx: https://github.com/bkaradzic/bgfx/blob/master/3rdparty/dear-imgui/widgets/markdown.h
Sorry for not creating PR...
Thanks for reporting those, fixing them asap!
Thanks @bkaradzic I've opened a question issue on this to get feedback.
There is bug here: https://github.com/juliettef/imgui_markdown/blob/d1726b1385f5790182892e41d4d8001a91fa0e04/imgui_markdown.h#L201
When
widthLeft
is too small to fit whole wordendPrevLine
doesn't advance and it causes infinite loop.My workaround was:
Other minor issues:
This: https://github.com/juliettef/imgui_markdown/blob/d1726b1385f5790182892e41d4d8001a91fa0e04/imgui_markdown.h#L155
Should be (fixes clang error):
HeadingFormat headingFormats[ NUMHEADINGS ] = { { NULL, true }, { NULL, true }, { NULL, true } };
Also I would suggest to create .h file that contains only definitions users should use. I did this inside bgfx: https://github.com/bkaradzic/bgfx/blob/master/3rdparty/dear-imgui/widgets/markdown.h
Sorry for not creating PR...