Changeset View
Changeset View
Standalone View
Standalone View
src/vimode/macros.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
79 | } | 79 | } | ||
80 | 80 | | |||
81 | void Macros::store(const QChar ®, const QList<QKeyEvent> ¯oKeyEventLog, const CompletionList &completions) | 81 | void Macros::store(const QChar ®, const QList<QKeyEvent> ¯oKeyEventLog, const CompletionList &completions) | ||
82 | { | 82 | { | ||
83 | m_macros[reg].clear(); | 83 | m_macros[reg].clear(); | ||
84 | QList<QKeyEvent> withoutClosingQ = macroKeyEventLog; | 84 | QList<QKeyEvent> withoutClosingQ = macroKeyEventLog; | ||
85 | Q_ASSERT(!macroKeyEventLog.isEmpty() && macroKeyEventLog.last().key() == Qt::Key_Q); | 85 | Q_ASSERT(!macroKeyEventLog.isEmpty() && macroKeyEventLog.last().key() == Qt::Key_Q); | ||
86 | withoutClosingQ.pop_back(); | 86 | withoutClosingQ.pop_back(); | ||
87 | foreach (const QKeyEvent &keyEvent, withoutClosingQ) { | 87 | for (const QKeyEvent &keyEvent : qAsConst(withoutClosingQ)) { | ||
88 | const QChar key = KeyParser::self()->KeyEventToQChar(keyEvent); | 88 | const QChar key = KeyParser::self()->KeyEventToQChar(keyEvent); | ||
89 | m_macros[reg].append(key); | 89 | m_macros[reg].append(key); | ||
90 | } | 90 | } | ||
91 | m_completions[reg] = completions; | 91 | m_completions[reg] = completions; | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | QString Macros::get(const QChar ®) const | 94 | QString Macros::get(const QChar ®) const | ||
95 | { | 95 | { | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |