diff options
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | menuitems.c | 6 |
3 files changed, 7 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b9b4809c..7cd104b0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1452,6 +1452,7 @@ Udo Richter <udo_richter@gmx.de> for adding "-fPIC" to the compiler options in Make.config.template when compiling plugins for reporting a missing '--vfat' in the vdr.1 man page + for fixing deleting the last character of a string menu item in insert mode Sven Kreiensen <svenk@kammer.uni-hannover.de> for his help in keeping 'channels.conf.terr' up to date @@ -4842,3 +4842,5 @@ Video Disk Recorder Revision History - Increased the APIVERSION to allow plugins that relied on the cStatus::MsgSetVolume() bug to react properly (suggested by Stefan Huelswitt). - Fixed cDevice::ToggleMute() (thanks to Christoph Haubrich). +- Fixed deleting the last character of a string menu item in insert mode (thanks + to Udo Richter). 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--; |