Merge pull request #222 from KalenAnson/master

Do not insert a backward delete
This commit is contained in:
Micha Mettke 2016-08-26 20:02:38 +02:00 committed by GitHub
commit abac1878eb
1 changed files with 4 additions and 0 deletions

View File

@ -10944,6 +10944,10 @@ nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
if (!glyph_len) return;
while ((text_len < total_len) && glyph_len)
{
/* don't insert a backward delete, just process the event */
if (unicode == 127)
break;
/* can't add newline in single-line mode */
if (unicode == '\n' && state->single_line)
break;