Kate
kateviinsertmode.cpp
Go to the documentation of this file.
148 KateViRange r( c.line(), c.column()-getCount(), c.line(), c.column(), ViMotion::ExclusiveMotion );
237 const QModelIndex oldCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
239 const QModelIndex newCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
254 const QModelIndex oldCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
256 const QModelIndex newCompletionItem = m_view->completionWidget()->treeView()->selectionModel()->currentIndex();
369 if (m_view->completionWidget()->isCompletionActive() && !m_viInputModeManager->isReplayingMacro() && !m_viInputModeManager->isReplayingLastChange())
371 // Filter out Enter/ Return's that trigger a completion when recording macros/ last change stuff; they
397 if (!m_viInputModeManager->isReplayingMacro() && !m_viInputModeManager->isReplayingLastChange())
566 const QString added = doc()->text(Range(m_viInputModeManager->getMarkPosition('^'), m_view->cursorPosition()));
612 KateViInputModeManager::Completion::CompletionType completionType = KateViInputModeManager::Completion::PlainText;
617 else if (m_textInsertedByCompletion.endsWith("()") || m_textInsertedByCompletion.endsWith("();"))
621 m_viInputModeManager->logCompletionEvent(KateViInputModeManager::Completion(m_textInsertedByCompletion, KateViewConfig::global()->wordCompletionRemoveTail(), completionType));
626 const KateViInputModeManager::Completion completion = m_viInputModeManager->nextLoggedCompletion();
634 while (cursorPos.column() >= 0 && (doc()->character(cursorPos).isLetterOrNumber() || doc()->character(cursorPos) == '_'))
642 while (cursorPos.column() < doc()->lineLength(cursorPos.line()) && (doc()->character(cursorPos).isLetterOrNumber() || doc()->character(cursorPos) == '_'))
649 // Should we merge opening brackets? Yes, if completion is a function with arguments and after the cursor
677 // Position cursor correctly i.e. we'll have added "functionname()" or "functionname();"; need to step back by
697 m_view->setCursorPosition(Cursor(m_view->cursorPosition().line(), m_view->cursorPosition().column() + offsetFinalCursorPosBy));
706 // a synthetic ctrl-space was just added to the last change keypresses by logCompletionEvent(), and we don't
715 const QString lineAfterCursor = doc()->text(Range(startPos, Cursor(startPos.line(), doc()->lineLength(startPos.line()))));
int pos(int nth) const
void updateViModeBarMode()
Update vi mode statusbar according to the current mode.
Definition: kateview.cpp:1568
bool handleKeypress(const QKeyEvent *e)
checks if the key is a valid command
Definition: kateviinsertmode.cpp:322
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Qt::KeyboardModifiers modifiers() const
QString & append(QChar ch)
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:958
Definition: katevimodebase.h:50
QModelIndex currentIndex() const
QItemSelectionModel * selectionModel() const
const QChar getCharAtVirtualColumn(QString &line, int virtualColumn, int tabWidht) const
Definition: katevimodebase.cpp:1290
void setCaretStyle(KateRenderer::caretStyles style, bool repaint=false)
Set the caret's style.
Definition: kateview.cpp:2413
void changeViMode(ViMode newMode)
changes the current vi mode to the given mode
Definition: kateviinputmodemanager.cpp:445
QString & prepend(QChar ch)
bool commandInsertContentOfRegister()
Definition: kateviinsertmode.cpp:269
Definition: katevimodebase.h:64
Definition: kateviinputmodemanager.h:49
const QChar KeyEventToQChar(const QKeyEvent &keyEvent)
Definition: katevikeyparser.cpp:674
void doNotLogCurrentKeypress()
Definition: kateviinputmodemanager.cpp:411
bool setCursorPosition(KTextEditor::Cursor position)
Definition: kateview.cpp:2418
void chop(int n)
Cursor m_textInsertedByCompletionEndPos
Definition: kateviinsertmode.h:96
void indent(KTextEditor::Range range, int change)
Definition: katedocument.cpp:2899
bool commandInsertFromAbove()
Definition: kateviinsertmode.cpp:58
bool isNull() const
QString completedText() const
Definition: kateviinputmodemanager.cpp:929
void clear()
Definition: kateviinsertmode.h:42
void setBlockPrependMode(KateViRange blockRange)
Definition: kateviinsertmode.cpp:585
KateCompletionWidget * completionWidget() const
Definition: kateview.cpp:2346
virtual bool insertText(const KTextEditor::Cursor &position, const QString &s, bool block=false)
Definition: katedocument.cpp:530
bool commandCompletePrevious()
Definition: kateviinsertmode.cpp:251
bool commandMoveOneWordLeft()
Definition: kateviinsertmode.cpp:207
CompletionType completionType() const
Definition: kateviinputmodemanager.cpp:937
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:303
Definition: kateviewinternal.h:58
bool isEmpty() const
void updateCursor(const Cursor &c) const
Definition: katevimodebase.cpp:932
KTextEditor::Cursor getMarkPosition(const QChar &mark) const
Definition: kateviinputmodemanager.cpp:781
virtual KTextEditor::Cursor documentEnd() const
Definition: katedocument.cpp:4681
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
bool removeTail() const
Definition: kateviinputmodemanager.cpp:933
bool m_countedRepeatsBeginOnNewLine
Definition: kateviinsertmode.h:92
bool commandToFirstCharacterInFile()
Definition: kateviinsertmode.cpp:182
Definition: kateviinsertmode.h:40
Definition: kateview.h:77
Cursor findNextWordStart(int fromLine, int fromColumn, bool onlyCurrentLine=false) const
Definition: katevimodebase.cpp:312
QString m_textInsertedByCompletion
Definition: kateviinsertmode.h:95
int key() const
Definition: katevimodebase.h:51
bool contains(QChar ch, Qt::CaseSensitivity cs) const
CompletionType
Definition: kateviinputmodemanager.h:188
QChar toLower() const
bool commandDeleteCharBackward()
Definition: kateviinsertmode.cpp:143
void repaint()
Definition: kateviinsertmode.h:41
Definition: katevirange.h:29
bool isCompletionActive() const
Definition: katecompletionwidget.cpp:748
bool commandMoveOneWordRight()
Definition: kateviinsertmode.cpp:220
bool commandToLastCharacterInFile()
Definition: kateviinsertmode.cpp:194
QChar getChosenRegister(const QChar &defaultReg) const
Definition: katevimodebase.cpp:940
QString mid(int position, int n) const
bool isReplayingMacro()
Definition: kateviinputmodemanager.cpp:369
bool m_isExecutingCompletion
Definition: kateviinsertmode.h:94
int findNextMergeableBracketPos(const Cursor &startPos)
Definition: kateviinsertmode.cpp:713
bool deleteRange(KateViRange &r, OperationMode mode=LineWise, bool addToRegister=true)
Definition: katevimodebase.cpp:65
KateViInputModeManager * m_viInputModeManager
Definition: katevimodebase.h:177
bool isReplayingLastChange() const
Definition: kateviinputmodemanager.h:163
int length() const
void logCompletionEvent(const Completion &completion)
Definition: kateviinputmodemanager.cpp:374
virtual QString text(const KTextEditor::Range &range, bool blockwise=false) const
Definition: katedocument.cpp:337
Definition: kateviinsertmode.h:39
QString left(int n) const
QString getRegisterContent(const QChar ®)
Definition: katevimodebase.cpp:947
int virtualCursorColumn() const
Return the virtual cursor column, each tab is expanded into the document's tabWidth characters...
Definition: kateview.cpp:1944
void leaveInsertMode(bool force=false)
Definition: kateviinsertmode.cpp:514
Definition: katevimodebase.h:52
Completion nextLoggedCompletion()
Definition: kateviinputmodemanager.cpp:388
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KateCompletionTree * treeView() const
Definition: katecompletionwidget.cpp:923
Cursor findPrevWordStart(int fromLine, int fromColumn, bool onlyCurrentLine=false) const
Definition: katevimodebase.cpp:493
void setTemporaryNormalMode(bool b)
Definition: kateviinputmodemanager.h:241
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
bool isLetterOrNumber() const
void setBlockAppendMode(KateViRange blockRange, BlockInsert b)
Definition: kateviinsertmode.cpp:594
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.