Kate
kateviinsertmode.cpp
Go to the documentation of this file.
122 KateViRange r( c.line(), c.column()-getCount(), c.line(), c.column(), ViMotion::ExclusiveMotion );
207 const QModelIndex oldCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
209 const QModelIndex newCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
224 const QModelIndex oldCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
226 const QModelIndex newCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
336 if (m_view->completionWidget()->isCompletionActive() && !m_viInputModeManager->isReplayingMacro() && !m_viInputModeManager->isReplayingLastChange())
338 // Filter out Enter/ Return's that trigger a completion when recording macros/ last change stuff; they
364 if (!m_viInputModeManager->isReplayingMacro() && !m_viInputModeManager->isReplayingLastChange())
531 const QString added = doc()->text(Range(m_viInputModeManager->getMarkPosition('^'), m_view->cursorPosition()));
577 KateViInputModeManager::Completion::CompletionType completionType = KateViInputModeManager::Completion::PlainText;
582 else if (m_textInsertedByCompletion.endsWith("()") || m_textInsertedByCompletion.endsWith("();"))
586 m_viInputModeManager->logCompletionEvent(KateViInputModeManager::Completion(m_textInsertedByCompletion, KateViewConfig::global()->wordCompletionRemoveTail(), completionType));
591 const KateViInputModeManager::Completion completion = m_viInputModeManager->nextLoggedCompletion();
599 while (cursorPos.column() >= 0 && (doc()->character(cursorPos).isLetterOrNumber() || doc()->character(cursorPos) == '_'))
607 while (cursorPos.column() < doc()->lineLength(cursorPos.line()) && (doc()->character(cursorPos).isLetterOrNumber() || doc()->character(cursorPos) == '_'))
614 // Should we merge opening brackets? Yes, if completion is a function with arguments and after the cursor
642 // Position cursor correctly i.e. we'll have added "functionname()" or "functionname();"; need to step back by
662 m_view->setCursorPosition(Cursor(m_view->cursorPosition().line(), m_view->cursorPosition().column() + offsetFinalCursorPosBy));
671 // a synthetic ctrl-space was just added to the last change keypresses by logCompletionEvent(), and we don't
680 const QString lineAfterCursor = doc()->text(Range(startPos, Cursor(startPos.line(), doc()->lineLength(startPos.line()))));
void updateViModeBarMode()
Update vi mode statusbar according to the current mode.
Definition: kateview.cpp:1548
bool handleKeypress(const QKeyEvent *e)
checks if the key is a valid command
Definition: kateviinsertmode.cpp:292
Cursor & start()
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
Definition: katerenderer.h:71
OperationMode getRegisterFlag(const QChar ®) const
Definition: katevimodebase.cpp:963
Definition: katevimodebase.h:50
virtual bool isValid() const
const QChar getCharAtVirtualColumn(QString &line, int virtualColumn, int tabWidht) const
Definition: katevimodebase.cpp:1292
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
bool commandInsertContentOfRegister()
Definition: kateviinsertmode.cpp:239
Definition: katevimodebase.h:64
Definition: kateviinputmodemanager.h:49
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)
Cursor m_textInsertedByCompletionEndPos
Definition: kateviinsertmode.h:95
void indent(KTextEditor::Range range, int change)
Definition: katedocument.cpp:2898
bool commandInsertFromAbove()
Definition: kateviinsertmode.cpp:58
QString completedText() const
Definition: kateviinputmodemanager.cpp:909
Definition: kateviinsertmode.h:42
void setBlockPrependMode(KateViRange blockRange)
Definition: kateviinsertmode.cpp:550
KateCompletionWidget * completionWidget() const
Definition: kateview.cpp:2321
virtual bool insertText(const KTextEditor::Cursor &position, const QString &s, bool block=false)
Definition: katedocument.cpp:530
bool commandCompletePrevious()
Definition: kateviinsertmode.cpp:221
bool commandMoveOneWordLeft()
Definition: kateviinsertmode.cpp:181
CompletionType completionType() const
Definition: kateviinputmodemanager.cpp:917
bool commandInsertFromBelow()
Definition: kateviinsertmode.cpp:77
virtual QChar character(const KTextEditor::Cursor &position) const
Definition: katedocument.cpp:388
Definition: katevirange.h:33
bool commandSwitchToNormalModeForJustOneCommand()
Definition: kateviinsertmode.cpp:273
Definition: kateviewinternal.h:57
void updateCursor(const Cursor &c) const
Definition: katevimodebase.cpp:937
KTextEditor::Cursor getMarkPosition(const QChar &mark) const
Definition: kateviinputmodemanager.cpp:769
virtual KTextEditor::Cursor documentEnd() const
Definition: katedocument.cpp:4682
bool removeTail() const
Definition: kateviinputmodemanager.cpp:913
const QString getLine(int lineNumber=-1) const
Definition: katevimodebase.cpp:119
bool m_countedRepeatsBeginOnNewLine
Definition: kateviinsertmode.h:91
bool commandToFirstCharacterInFile()
Definition: kateviinsertmode.cpp:156
Definition: kateviinsertmode.h:40
Definition: kateview.h:78
virtual QString text() const =0
Cursor findNextWordStart(int fromLine, int fromColumn, bool onlyCurrentLine=false) const
Definition: katevimodebase.cpp:317
QString m_textInsertedByCompletion
Definition: kateviinsertmode.h:94
Definition: katevimodebase.h:51
CompletionType
Definition: kateviinputmodemanager.h:178
bool commandDeleteCharBackward()
Definition: kateviinsertmode.cpp:117
Definition: kateviinsertmode.h:41
Definition: katevirange.h:29
virtual int line() const
bool isCompletionActive() const
Definition: katecompletionwidget.cpp:746
bool commandMoveOneWordRight()
Definition: kateviinsertmode.cpp:190
bool commandToLastCharacterInFile()
Definition: kateviinsertmode.cpp:168
QChar getChosenRegister(const QChar &defaultReg) const
Definition: katevimodebase.cpp:945
virtual void setLine(int line)
bool isReplayingMacro()
Definition: kateviinputmodemanager.cpp:368
bool m_isExecutingCompletion
Definition: kateviinsertmode.h:93
int findNextMergeableBracketPos(const Cursor &startPos)
Definition: kateviinsertmode.cpp:678
bool deleteRange(KateViRange &r, OperationMode mode=LineWise, bool addToRegister=true)
Definition: katevimodebase.cpp:61
Cursor & end()
KateViInputModeManager * m_viInputModeManager
Definition: katevimodebase.h:177
bool isReplayingLastChange() const
Definition: kateviinputmodemanager.h:153
void logCompletionEvent(const Completion &completion)
Definition: kateviinputmodemanager.cpp:373
virtual QString text(const KTextEditor::Range &range, bool blockwise=false) const
Definition: katedocument.cpp:337
Definition: kateviinsertmode.h:39
QString getRegisterContent(const QChar ®)
Definition: katevimodebase.cpp:952
int virtualCursorColumn() const
Return the virtual cursor column, each tab is expanded into the document's tabWidth characters...
Definition: kateview.cpp:1919
void leaveInsertMode(bool force=false)
Definition: kateviinsertmode.cpp:479
Definition: katevimodebase.h:52
Completion nextLoggedCompletion()
Definition: kateviinputmodemanager.cpp:387
KateCompletionTree * treeView() const
Definition: katecompletionwidget.cpp:921
Cursor findPrevWordStart(int fromLine, int fromColumn, bool onlyCurrentLine=false) const
Definition: katevimodebase.cpp:498
virtual void setColumn(int column)
int column() const
void setTemporaryNormalMode(bool b)
Definition: kateviinputmodemanager.h:231
const KShortcut & completion()
virtual bool removeText(const KTextEditor::Range &range, bool block=false)
Definition: katedocument.cpp:633
KateViInsertMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal)
Definition: kateviinsertmode.cpp:35
void setBlockAppendMode(KateViRange blockRange, BlockInsert b)
Definition: kateviinsertmode.cpp:559
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.