forked from qt-creator/qt-creator
fakevim: use BaseTextEditor's isElectricCharacter
in order for automatic indenting to work, isElectricCharacter has to match the language of the document Merge-request: 98 Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
10
src/plugins/fakevim/fakevimhandler.cpp
Normal file → Executable file
10
src/plugins/fakevim/fakevimhandler.cpp
Normal file → Executable file
@@ -322,8 +322,7 @@ public:
|
||||
{ setPosition(p.position); scrollToLineInDocument(p.scrollLine); }
|
||||
|
||||
// helper functions for indenting
|
||||
bool isElectricCharacter(QChar c) const
|
||||
{ return c == '{' || c == '}' || c == '#'; }
|
||||
bool isElectricCharacter(QChar c) const;
|
||||
void indentRegion(QChar lastTyped = QChar());
|
||||
void shiftRegionLeft(int repeat = 1);
|
||||
void shiftRegionRight(int repeat = 1);
|
||||
@@ -2429,6 +2428,13 @@ void FakeVimHandler::Private::indentRegion(QChar typedChar)
|
||||
setDotCommand("%1==", endLine - beginLine + 1);
|
||||
}
|
||||
|
||||
bool FakeVimHandler::Private::isElectricCharacter(QChar c) const
|
||||
{
|
||||
bool result = false;
|
||||
emit q->checkForElectricCharacter(&result, c);
|
||||
return result;
|
||||
}
|
||||
|
||||
void FakeVimHandler::Private::shiftRegionRight(int repeat)
|
||||
{
|
||||
int beginLine = lineForPosition(anchor());
|
||||
|
||||
Reference in New Issue
Block a user