| 1 | /* |
|---|---|
| 2 | SPDX-FileCopyrightText: 2008 Erlend Hamberg <ehamberg@gmail.com> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #include <vimode/motion.h> |
| 8 | |
| 9 | using namespace KateVi; |
| 10 | |
| 11 | Motion::Motion(const QString &pattern, Range (NormalViMode::*commandMethod)(), unsigned int flags) |
| 12 | : Command(pattern, nullptr, flags) |
| 13 | { |
| 14 | m_ptr2commandMethod = commandMethod; |
| 15 | } |
| 16 | |
| 17 | Range Motion::execute(NormalViMode *mode) const |
| 18 | { |
| 19 | return (mode->*m_ptr2commandMethod)(); |
| 20 | } |
| 21 |
