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:
Martin Aumüller
2010-01-06 14:57:46 +01:00
committed by hjk
parent 46abe329f4
commit c4fede0fd3
3 changed files with 21 additions and 2 deletions

10
src/plugins/fakevim/fakevimhandler.cpp Normal file → Executable file
View 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());