forked from len0rd/rockbox
Synched with recorder: Starts editing at the end of the string.
Bug with long strings fixed (Strings longer than newchars was truncated.) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3431 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
42f261eebe
commit
cad6f24a50
1 changed files with 7 additions and 3 deletions
|
|
@ -97,6 +97,10 @@ int kbd_input(char* text, int buflen)
|
||||||
|
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
|
|
||||||
|
old_cursor_pos=cursor_pos=strlen(text);
|
||||||
|
if (9<cursor_pos)
|
||||||
|
left_pos=cursor_pos-9;
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
int i, p;
|
int i, p;
|
||||||
int len = strlen(text);
|
int len = strlen(text);
|
||||||
|
|
@ -109,8 +113,8 @@ int kbd_input(char* text, int buflen)
|
||||||
left_pos--;
|
left_pos--;
|
||||||
p=0;
|
p=0;
|
||||||
i = left_pos;
|
i = left_pos;
|
||||||
while (p<10 && line[i]) {
|
while (p<10 && text[i]) {
|
||||||
temptext[p++]=text[i++];
|
temptext[p++]=text[i++];
|
||||||
}
|
}
|
||||||
temptext[p]=0;
|
temptext[p]=0;
|
||||||
lcd_remove_cursor();
|
lcd_remove_cursor();
|
||||||
|
|
@ -128,7 +132,7 @@ int kbd_input(char* text, int buflen)
|
||||||
for (i=1; i < 8; i++) {
|
for (i=1; i < 8; i++) {
|
||||||
temptext[i+2]=line[(i+x)%linelen];
|
temptext[i+2]=line[(i+x)%linelen];
|
||||||
}
|
}
|
||||||
temptext[p]=0;
|
temptext[i+2]=0;
|
||||||
lcd_puts(1, 1, temptext);
|
lcd_puts(1, 1, temptext);
|
||||||
break;
|
break;
|
||||||
case MENU_LINE_BACKSPACE:
|
case MENU_LINE_BACKSPACE:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue