diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-24 00:03:37 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-24 00:03:37 (GMT) |
| commit | 3f6921229b9761748e22066663b0fa0777ff850b (patch) | |
| tree | 06a97c48397f4f7a5bb5611dfb7b40c799ede53c /src/interface.c | |
| parent | 5e44345702609a29c68b7ec36b87d05f1bd83ba0 (diff) | |
| download | powder-3f6921229b9761748e22066663b0fa0777ff850b.zip powder-3f6921229b9761748e22066663b0fa0777ff850b.tar.gz | |
Correct pasting text within existing text, courtesy of jacob1
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c index 8c494b7..42a1fac 100644 --- a/src/interface.c +++ b/src/interface.c @@ -447,7 +447,7 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) int pl = strlen(paste); if ((textwidth(str)+textwidth(paste) > ed->w-14 && !ed->multiline) || (pl+strlen(ed->str)>255) || (float)(((textwidth(str)+textwidth(paste))/(ed->w-14)*12) > ed->h && ed->multiline)) break; - memmove(ed->str+ed->cursor+pl, ed->str+ed->cursor, l+pl-ed->cursor); + memmove(ed->str+ed->cursor+pl, ed->str+ed->cursor, l-ed->cursor+1); memcpy(ed->str+ed->cursor,paste,pl); ed->cursor += pl; break; |
