mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:27:35 +00:00
Ladybird: Implement JS console input history
One can now use KeyUp and KeyDown to navigate through the already run commands in the JS console.
This commit is contained in:
parent
6f15b92ace
commit
8e8f124ca9
2 changed files with 64 additions and 15 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <QLineEdit>
|
||||
#include <QWidget>
|
||||
|
||||
class QLineEdit;
|
||||
|
@ -48,4 +49,21 @@ private:
|
|||
bool m_waiting_for_messages { false };
|
||||
};
|
||||
|
||||
class ConsoleInputEdit final : public QLineEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConsoleInputEdit(QWidget* q_widget, ConsoleWidget& console_widget)
|
||||
: QLineEdit(q_widget)
|
||||
, m_console_widget(console_widget)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
ConsoleWidget& m_console_widget;
|
||||
Vector<DeprecatedString> m_history;
|
||||
size_t m_history_index { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue