Kate
kateviinputmodemanager.cpp
Go to the documentation of this file.
72 m_keyMapperStack.push(QSharedPointer<KateViKeyMapper>(new KateViKeyMapper(this, m_view->doc(), m_view)));
98 m_view->setCursorPosition(Cursor(view->selectionRange().end().line(), view->selectionRange().end().column() - 1));
117 const bool isSyntheticSearchCompletedKeyPress = m_view->viModeEmulatedCommandBar()->isSendingSyntheticSearchCompletedKeypress();
119 // With macros, we want to record the keypresses *before* they are mapped, but if they end up *not* being part
121 // the "!isPlayingBackRejectedKeys()". And obviously, since we're recording keys before they are mapped, we don't
122 // want to also record the executed mapping, as when we replayed the macro, we'd get duplication!
123 if (isRecordingMacro() && !isReplayingMacro() && !isSyntheticSearchCompletedKeyPress && !keyMapper()->isExecutingMapping() && !keyMapper()->isPlayingBackRejectedKeys())
136 if (e->key() != Qt::Key_Control && e->key() != Qt::Key_Shift && e->key() != Qt::Key_Alt && e->key() != Qt::Key_Meta)
303 keyPress.append( keyCode <= 0xFF ? QChar( keyCode ) : KateViKeyParser::self()->qt2vi( keyCode ) );
337 KateGlobal::self()->viInputModeGlobal()->storeMacro(m_recordingMacroRegister, m_currentMacroKeyEventsLog, m_currentMacroCompletionsLog);
353 const QString macroAsFeedableKeypresses = KateGlobal::self()->viInputModeGlobal()->getMacro(macroRegister);
358 m_macroCompletionsToReplay.push(KateGlobal::self()->viInputModeGlobal()->getMacroCompletions(macroRegister));
359 m_keyMapperStack.push(QSharedPointer<KateViKeyMapper>(new KateViKeyMapper(this, m_view->doc(), m_view)));
373 void KateViInputModeManager::logCompletionEvent(const KateViInputModeManager::Completion& completion)
394 kDebug(13070) << "Something wrong here: requesting more completions for last change than we actually have. Returning dummy.";
403 kDebug(13070) << "Something wrong here: requesting more completions for macro than we actually have. Returning dummy.";
507 m_currentChangeKeyEventsLog.append(QKeyEvent(QEvent::KeyPress, QString("i")[0].unicode(), Qt::NoModifier, "i"));
588 KateGlobal::self()->viInputModeGlobal()->fillRegister( names.at( i ).at( 0 ), contents.at( i ), (OperationMode)( flags.at( i ) ) );
615 const QMap<QChar, KateViRegister>* regs = KateGlobal::self()->viInputModeGlobal()->getRegisters();
898 KateViInputModeManager::Completion::Completion(const QString& completedText, bool removeTail, CompletionType completionType)
905 kDebug(13070) << "Completing a function while not removing tail currently unsupported; will remove tail instead";
917 KateViInputModeManager::Completion::CompletionType KateViInputModeManager::Completion::completionType() const
void cursorPrevChar(bool sel=false)
Definition: kateviewinternal.cpp:1061
const QString getVerbatimKeys() const
Definition: kateviinputmodemanager.cpp:554
Definition: kateviinputmodemanager.h:50
void viEnterNormalMode()
set normal mode to be the active vi mode and perform the needed setup work
Definition: kateviinputmodemanager.cpp:472
void replayMacro(QChar macroRegister)
Definition: kateviinputmodemanager.cpp:345
void finishRecordingMacro()
Definition: kateviinputmodemanager.cpp:333
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
bool getTemporaryNormalMode()
Definition: kateviinputmodemanager.h:229
Definition: katerenderer.h:71
virtual KTextEditor::MovingCursor * newMovingCursor(const KTextEditor::Cursor &position, KTextEditor::MovingCursor::InsertBehavior insertBehavior=KTextEditor::MovingCursor::MoveOnInsert)
Create a new moving cursor for this document.
Definition: katedocument.cpp:4737
void syncViMarksAndBookmarks()
Definition: kateviinputmodemanager.cpp:808
virtual int column() const =0
void addMark(KateDocument *doc, const QChar &mark, const KTextEditor::Cursor &pos, const bool moveoninsert=true, const bool showmark=true)
Add a mark to the document.
Definition: kateviinputmodemanager.cpp:725
virtual KTextEditor::View * activeView() const
Definition: katedocument.h:156
void setCaretStyle(KateRenderer::caretStyles style, bool repaint=false)
Set the caret's style.
Definition: kateview.cpp:2388
void changeViMode(ViMode newMode)
changes the current vi mode to the given mode
Definition: kateviinputmodemanager.cpp:444
void storeMacro(QChar macroRegister, const QList< QKeyEvent > macroKeyEventLog, const QList< KateViInputModeManager::Completion > completions)
Definition: kateviglobal.cpp:302
Definition: katevimodebase.h:64
Definition: kateviinputmodemanager.h:51
Definition: kateviinputmodemanager.h:54
void startRecordingMacro(QChar macroRegister)
Definition: kateviinputmodemanager.cpp:322
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
KateViInputModeManager(KateView *view, KateViewInternal *viewInternal)
Definition: kateviinputmodemanager.cpp:50
Definition: kateviinputmodemanager.h:49
bool isSendingSyntheticSearchCompletedKeypress()
Definition: kateviemulatedcommandbar.cpp:1217
int line
const QChar KeyEventToQChar(const QKeyEvent &keyEvent)
Definition: katevikeyparser.cpp:661
void doNotLogCurrentKeypress()
Definition: kateviinputmodemanager.cpp:410
bool setCursorPosition(KTextEditor::Cursor position)
Definition: kateview.cpp:2393
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Definition: kateviinputmodemanager.h:57
void updateSelection()
Updates the visual mode's range to reflect a new cursor position.
Definition: katevivisualmode.cpp:257
KTextEditor::Cursor getNextJump(KTextEditor::Cursor cursor)
Definition: kateviinputmodemanager.cpp:675
QString completedText() const
Definition: kateviinputmodemanager.cpp:909
virtual const KTextEditor::Range & selectionRange() const
Definition: kateview.cpp:2760
void addJump(KTextEditor::Cursor cursor)
Definition: kateviinputmodemanager.cpp:656
QString getMacro(QChar macroRegister)
Get the named macro in a format suitable for passing to feedKeyPresses.
Definition: kateviglobal.cpp:316
~KateViInputModeManager()
Definition: kateviinputmodemanager.cpp:103
const QString getLastSearchPattern() const
The current search pattern.
Definition: kateviinputmodemanager.cpp:421
CompletionType completionType() const
Definition: kateviinputmodemanager.cpp:917
Completion(const QString &completedText, bool removeTail, CompletionType completionType)
Definition: kateviinputmodemanager.cpp:898
MarkChangeAction
virtual bool handleKeypress(const QKeyEvent *e)=0
Definition: katerenderer.h:72
void beginMonitoringDocumentChanges()
Definition: katevinormalmode.cpp:485
Definition: kateviewinternal.h:57
KateViKeyMapper * keyMapper()
Definition: kateviinputmodemanager.cpp:893
const QString decodeKeySequence(const QString &keys) const
Definition: katevikeyparser.cpp:619
KTextEditor::Cursor getMarkPosition(const QChar &mark) const
Definition: kateviinputmodemanager.cpp:769
KateViNormalMode * getViNormalMode()
Definition: kateviinputmodemanager.cpp:534
const QMap< QChar, KateViRegister > * getRegisters() const
Definition: kateviglobal.h:58
void viEnterVisualMode(ViMode visualMode=VisualMode)
set visual mode to be the active vi mode and make the needed setup work
Definition: kateviinputmodemanager.cpp:514
Definition: katevivisualmode.h:34
KateViModeBase * getCurrentViModeHandler() const
Definition: kateviinputmodemanager.cpp:454
bool removeTail() const
Definition: kateviinputmodemanager.cpp:913
void writeSessionConfig(KConfigGroup &config)
Definition: kateviinputmodemanager.cpp:612
Definition: katerenderer.h:70
Definition: katevikeymapper.h:33
const QString encodeKeySequence(const QString &keys) const
Definition: katevikeyparser.cpp:507
Definition: kateview.h:78
Definition: kateviinputmodemanager.h:53
void setSearchPattern(const QString &searchPattern)
Set the current search pattern.
Definition: kateview.cpp:2451
Definition: katedocument.h:74
CompletionType
Definition: kateviinputmodemanager.h:178
void readSessionConfig(const KConfigGroup &config)
Definition: kateviinputmodemanager.cpp:576
KateViReplaceMode * getViReplaceMode()
Definition: kateviinputmodemanager.cpp:549
void setVisualModeType(ViMode mode)
Definition: katevivisualmode.cpp:233
Definition: kateviinputmodemanager.h:52
virtual int line() const
void storeLastChangeCommand()
copy the contents of the key events log to m_lastChange so that it can be repeated ...
Definition: kateviinputmodemanager.cpp:278
virtual int line() const =0
bool handleKeyPress(const QKeyEvent *keyEvent)
Definition: kateviemulatedcommandbar.cpp:927
bool handleKeypress(const QKeyEvent *e)
feed key the given key press to the command parser
Definition: kateviinputmodemanager.cpp:112
bool isReplayingMacro()
Definition: kateviinputmodemanager.cpp:368
void appendKeyEventToLog(const QKeyEvent &e)
append a QKeyEvent to the key event log
Definition: kateviinputmodemanager.cpp:270
KateViEmulatedCommandBar * viModeEmulatedCommandBar()
Definition: kateview.cpp:2989
virtual void removeMark(int line, uint markType)
Definition: katedocument.cpp:1714
Cursor & end()
KTextEditor::Cursor getPrevJump(KTextEditor::Cursor cursor)
Definition: kateviinputmodemanager.cpp:692
CopyJob * copy(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
bool isReplayingLastChange() const
Definition: kateviinputmodemanager.h:153
bool isRecordingMacro()
Definition: kateviinputmodemanager.cpp:340
void setLastSearchPattern(const QString &p)
Set the current search pattern.
Definition: kateviinputmodemanager.cpp:433
static QString modeToString(ViMode mode)
convert mode to string representation for user
Definition: kateviinputmodemanager.cpp:866
void logCompletionEvent(const Completion &completion)
Definition: kateviinputmodemanager.cpp:373
virtual QString text(const KTextEditor::Range &range, bool blockwise=false) const
Definition: katedocument.cpp:337
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual const QHash< int, KTextEditor::Mark * > & marks()
Definition: katedocument.cpp:1747
KateViInsertMode * getViInsertMode()
Definition: kateviinputmodemanager.cpp:539
void repeatLastChange()
repeat last change by feeding the contents of m_lastChange to feedKeys()
Definition: kateviinputmodemanager.cpp:314
Completion nextLoggedCompletion()
Definition: kateviinputmodemanager.cpp:387
KateViVisualMode * getViVisualMode()
Definition: kateviinputmodemanager.cpp:544
ViMode getCurrentViMode() const
Definition: kateviinputmodemanager.cpp:449
void feedKeyPresses(const QString &keyPresses) const
feed key the given list of key presses to the key handling code, one by one
Definition: kateviinputmodemanager.cpp:171
Definition: kateviinsertmode.h:45
int column() const
void fillRegister(const QChar ®, const QString &text, OperationMode flag=CharWise)
Definition: kateviglobal.cpp:146
T readEntry(const QString &key, const T &aDefault) const
void setTemporaryNormalMode(bool b)
Definition: kateviinputmodemanager.h:231
bool isHandlingKeypress() const
Determines whether we are currently processing a Vi keypress.
Definition: kateviinputmodemanager.cpp:265
void viEnterInsertMode()
set insert mode to be the active vi mode and perform the needed setup work
Definition: kateviinputmodemanager.cpp:499
void viEnterReplaceMode()
set replace mode to be the active vi mode and make the needed setup work
Definition: kateviinputmodemanager.cpp:526
QString getMarksOnTheLine(int line)
Definition: kateviinputmodemanager.cpp:852
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.