Fix history scroll behavior in repl and dbg

This commit is contained in:
K. Lange 2021-03-27 13:11:01 +09:00
parent 57970d662e
commit 71685ade0a

View File

@ -427,7 +427,10 @@ static int debuggerHook(KrkCallFrame * frame) {
}
} else {
#ifndef NO_RLINE
if (enableRline) rline_history_insert(strdup(buf));
if (enableRline) {
rline_history_insert(strdup(buf));
rline_scroll = 0;
}
#endif
if (lastDebugCommand) free(lastDebugCommand);
lastDebugCommand = strdup(buf);
@ -1094,7 +1097,10 @@ _finishArgs:
for (size_t i = 0; i < lineCount; ++i) {
if (valid) strcat(allData, lines[i]);
#ifndef NO_RLINE
if (enableRline) rline_history_insert(strdup(lines[i]));
if (enableRline) {
rline_history_insert(strdup(lines[i]));
rline_scroll = 0;
}
#endif
free(lines[i]);
}