1 | /* |
---|---|
2 | SPDX-FileCopyrightText: KDE Developers |
3 | |
4 | SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | |
7 | #include "kateviinputmodefactory.h" |
8 | #include "kateviinputmode.h" |
9 | #include "vimode/globalstate.h" |
10 | #include <vimode/config/configtab.h> |
11 | |
12 | #include <KConfig> |
13 | #include <KLocalizedString> |
14 | |
15 | KateViInputModeFactory::KateViInputModeFactory() |
16 | : KateAbstractInputModeFactory() |
17 | , m_viGlobal(new KateVi::GlobalState()) |
18 | { |
19 | } |
20 | |
21 | KateAbstractInputMode *KateViInputModeFactory::createInputMode(KateViewInternal *viewInternal) |
22 | { |
23 | return new KateViInputMode(viewInternal, m_viGlobal.get()); |
24 | } |
25 | |
26 | KateConfigPage *KateViInputModeFactory::createConfigPage(QWidget *parent) |
27 | { |
28 | return new KateVi::ConfigTab(parent, m_viGlobal->mappings()); |
29 | } |
30 | |
31 | KTextEditor::View::InputMode KateViInputModeFactory::inputMode() |
32 | { |
33 | return KTextEditor::View::ViInputMode; |
34 | } |
35 | |
36 | QString KateViInputModeFactory::name() |
37 | { |
38 | return i18n("Vi Input Mode"); |
39 | } |
40 |