possible fix from jacksonmj, cursor gets set to end while changing commands with up/down
This commit is contained in:
parent
8ed2947b4c
commit
6aaa9e78cd
@ -3883,7 +3883,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show
|
|||||||
currentcommand->prev_command = last_command;
|
currentcommand->prev_command = last_command;
|
||||||
currentcommand->command = mystrdup(ed.str);
|
currentcommand->command = mystrdup(ed.str);
|
||||||
last_command = currentcommand;
|
last_command = currentcommand;
|
||||||
return ed.str;
|
return currentcommand->command;
|
||||||
}
|
}
|
||||||
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
|
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
|
||||||
{
|
{
|
||||||
@ -3910,6 +3910,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show
|
|||||||
currentcommand = currentcommand->prev_command;
|
currentcommand = currentcommand->prev_command;
|
||||||
}
|
}
|
||||||
strcpy(ed.str, currentcommand->command);
|
strcpy(ed.str, currentcommand->command);
|
||||||
|
ed.cursor = strlen(ed.str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1121,7 +1121,7 @@ int main(int argc, char *argv[])
|
|||||||
pixel *pers_bg=calloc((XRES+BARSIZE)*YRES, PIXELSIZE);
|
pixel *pers_bg=calloc((XRES+BARSIZE)*YRES, PIXELSIZE);
|
||||||
void *http_ver_check;
|
void *http_ver_check;
|
||||||
char *ver_data=NULL, *tmp;
|
char *ver_data=NULL, *tmp;
|
||||||
char error[255];
|
char error[255] = "";
|
||||||
int i, j, bq, fire_fc=0, do_check=0, old_version=0, http_ret=0, major, minor, old_ver_len;
|
int i, j, bq, fire_fc=0, do_check=0, old_version=0, http_ret=0, major, minor, old_ver_len;
|
||||||
#ifdef INTERNAL
|
#ifdef INTERNAL
|
||||||
int vs = 0;
|
int vs = 0;
|
||||||
@ -1707,6 +1707,7 @@ int main(int argc, char *argv[])
|
|||||||
//char error[255] = "error!";
|
//char error[255] = "error!";
|
||||||
sys_pause = 1;
|
sys_pause = 1;
|
||||||
console = console_ui(vid_buf,error);
|
console = console_ui(vid_buf,error);
|
||||||
|
console = mystrdup(console);
|
||||||
strcpy(error,"");
|
strcpy(error,"");
|
||||||
if(console && strcmp(console, "")!=0 && strncmp(console, " ", 1)!=0)
|
if(console && strcmp(console, "")!=0 && strncmp(console, " ", 1)!=0)
|
||||||
{
|
{
|
||||||
@ -1716,6 +1717,7 @@ int main(int argc, char *argv[])
|
|||||||
console5 = strtok(NULL, " ");
|
console5 = strtok(NULL, " ");
|
||||||
if(strcmp(console2, "quit")==0)
|
if(strcmp(console2, "quit")==0)
|
||||||
{
|
{
|
||||||
|
free(console);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(strcmp(console2, "load")==0 && console3)
|
else if(strcmp(console2, "load")==0 && console3)
|
||||||
@ -1955,6 +1957,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
sprintf(error, "Invalid Command", console2);
|
sprintf(error, "Invalid Command", console2);
|
||||||
}
|
}
|
||||||
|
free(console);
|
||||||
if(!console_mode)
|
if(!console_mode)
|
||||||
hud_enable = 1;
|
hud_enable = 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user