7#ifndef KATEVI_EMULATED_COMMAND_BAR_COMMANDMODE_H
8#define KATEVI_EMULATED_COMMAND_BAR_COMMANDMODE_H
10#include "activemode.h"
25class MatchHighlighter;
26class InteractiveSedReplaceMode;
28class InputModeManager;
30class CommandMode :
public ActiveMode
33 CommandMode(EmulatedCommandBar *emulatedCommandBar,
34 MatchHighlighter *matchHighlighter,
35 InputModeManager *viInputModeManager,
36 KTextEditor::ViewPrivate *view,
38 InteractiveSedReplaceMode *interactiveSedReplaceMode,
39 Completer *completer);
40 ~CommandMode()
override
43 bool handleKeyPress(
const QKeyEvent *keyEvent)
override;
44 void editTextChanged(
const QString &newText)
override;
45 CompletionStartParams completionInvoked(Completer::CompletionInvocation invocationType)
override;
46 void completionChosen()
override;
47 void deactivate(
bool wasAborted)
override;
48 QString executeCommand(
const QString &commandToExecute);
51 CompletionStartParams activateCommandCompletion();
52 CompletionStartParams activateCommandHistoryCompletion();
53 CompletionStartParams activateSedFindHistoryCompletion();
54 CompletionStartParams activateSedReplaceHistoryCompletion();
55 QString withoutRangeExpression();
56 QString rangeExpression();
57 QString withSedFindTermReplacedWith(
const QString &newFindTerm);
58 QString withSedDelimiterEscaped(
const QString &text);
59 bool isCursorInFindTermOfSed();
60 bool isCursorInReplaceTermOfSed();
61 QString sedFindTerm();
62 QString sedReplaceTerm();
68 struct ParsedSedExpression {
69 bool parsedSuccessfully;
80 CommandMode::ParsedSedExpression parseAsSedExpression();
81 int commandBeforeCursorBegin();
83 InteractiveSedReplaceMode *m_interactiveSedReplaceMode;
84 Completer *m_completer;
85 KCompletion m_cmdCompletion;
86 QHash<QString, KTextEditor::Command *> m_cmdDict;
87 KTextEditor::Command *queryCommand(
const QString &cmd)
const;
An Editor command line command.
A KateViewBarWidget that attempts to emulate some of the features of Vim's own command bar,...
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...