diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-30 09:09:30 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-30 09:09:30 +0200 |
commit | cacd58d0362b26190df7cb1505ac1c75a41a45ab (patch) | |
tree | fcb67f9baa30cec915960282075a258b15737963 /menuitems.c | |
parent | cdad4a6b4e1b3c11099c7587714946629400bce3 (diff) | |
download | vdr-cacd58d0362b26190df7cb1505ac1c75a41a45ab.tar.gz vdr-cacd58d0362b26190df7cb1505ac1c75a41a45ab.tar.bz2 |
Fixed deleting the last character of a string menu item in insert mode
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/menuitems.c b/menuitems.c index cbfcf053..086668ee 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.46 2006/07/23 09:42:17 kls Exp $ + * $Id: menuitems.c 1.47 2006/07/30 09:09:30 kls Exp $ */ #include "menuitems.h" @@ -313,7 +313,7 @@ void cMenuEditStrItem::Set(void) SetValue(buf); return; } - width -= font->Width('>'); // assuming '<' and '>' have the same with + width -= font->Width('>'); // assuming '<' and '>' have the same width int w = 0; int i = 0; int l = strlen(buf); @@ -395,6 +395,8 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key) if (strlen(value) > 1) { if (!insert || pos < int(strlen(value)) - 1) memmove(value + pos, value + pos + 1, strlen(value) - pos); + else if (insert && pos == int(strlen(value)) - 1) + value[pos] = ' '; // in insert mode, deleting the last character replaces it with a blank to keep the cursor position // reduce position, if we removed the last character if (pos == int(strlen(value))) pos--; |