1/*
2 SPDX-FileCopyrightText: KDE Developers
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "history.h"
8
9using namespace KateVi;
10
11namespace
12{
13const int HISTORY_SIZE_LIMIT = 100;
14}
15
16void History::append(const QString &historyItem)
17{
18 if (historyItem.isEmpty()) {
19 return;
20 }
21
22 m_items.removeAll(t: historyItem);
23
24 if (m_items.size() == HISTORY_SIZE_LIMIT) {
25 m_items.removeFirst();
26 }
27
28 m_items.append(t: historyItem);
29}
30
31void History::clear()
32{
33 m_items.clear();
34}
35

source code of ktexteditor/src/vimode/history.cpp