[Scummvm-git-logs] scummvm master -> 3d3cd083bfb04de61d9b6d651602822fb5027779

criezy noreply at scummvm.org
Tue Apr 12 21:29:23 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3d3cd083bf GUI: Fix scrolling history in the Console widget


Commit: 3d3cd083bfb04de61d9b6d651602822fb5027779
    https://github.com/scummvm/scummvm/commit/3d3cd083bfb04de61d9b6d651602822fb5027779
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-04-12T22:29:13+01:00

Commit Message:
GUI: Fix scrolling history in the Console widget

When starting to scroll, the current line is added to the history
so that if we scroll up and then down we get it back. This was
initially implemented correctly, but borken later on in 51dceaf1659
when the history was changed to use Common::String.

Changed paths:
    gui/console.cpp


diff --git a/gui/console.cpp b/gui/console.cpp
index 5ad8984dac6..df81e17370f 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -641,11 +641,9 @@ void ConsoleDialog::historyScroll(int direction) {
 	if (_historySize == 0)
 		return;
 
-	if (_historyLine == 0 && direction > 0) {
-		int i;
-		for (i = 0; i < _promptEndPos - _promptStartPos; i++)
-			_history[_historyIndex].insertChar(buffer(_promptStartPos + i), i);
-	}
+	if (_historyLine == 0 && direction > 0)
+		// Save current line in history
+		_history[_historyIndex] = getUserInput();
 
 	// Advance to the next line in the history
 	int line = _historyLine + direction;




More information about the Scummvm-git-logs mailing list