enkisoftware / imgui_markdown

Markdown for Dear ImGui
zlib License
1.03k stars 69 forks source link

imgui_markdown does not display the last character #3

Closed BrutPitt closed 5 years ago

BrutPitt commented 5 years ago

Hi

As mentioned on twitter I started using imgui_markdown in glChAoS.P

Using imgui_markdown with my help strings I realized that it does not display the last character.

If the string is in form:

std::string markdownText = u8R"(
aaaaaP
)";

the problem does not seem to appear, because the last char is \n, but if I use: std::string markdownText = u8R"(aaaaaP)"; or a more simple: std::string markdownText = "aaaaP"; the P is not printed.

Thanks

juliettef commented 5 years ago

Thanks, I'll take a look.

dougbinks commented 5 years ago

Fixed - we weren't handling non-null terminated strings, as although we'd put std::string in our example we don't use them internally.

BrutPitt commented 5 years ago

Thanks!