forked from qt-creator/qt-creator
FakeVim: Fix a deprecation warning
... and re-organize surrounding code a bit. Change-Id: I0c3af5b2a434c5088ed165fed97d562f468d16fc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -2155,6 +2155,7 @@ public:
|
||||
bool handleExWriteCommand(const ExCommand &cmd);
|
||||
bool handleExEchoCommand(const ExCommand &cmd);
|
||||
|
||||
void setTabSize(int tabSize);
|
||||
void setupCharClass();
|
||||
int charClass(QChar c, bool simple) const;
|
||||
signed char m_charClass[256];
|
||||
@@ -2686,17 +2687,22 @@ void FakeVimHandler::Private::ensureCursorVisible()
|
||||
|
||||
void FakeVimHandler::Private::updateEditor()
|
||||
{
|
||||
const int charWidth = QFontMetrics(EDITOR(font())).horizontalAdvance(' ');
|
||||
EDITOR(setTabStopWidth(charWidth * config(ConfigTabStop).toInt()));
|
||||
setTabSize(config(ConfigTabStop).toInt());
|
||||
setupCharClass();
|
||||
}
|
||||
|
||||
void FakeVimHandler::Private::setTabSize(int tabSize)
|
||||
{
|
||||
const int charWidth = QFontMetrics(EDITOR(font())).horizontalAdvance(' ');
|
||||
const int width = charWidth * tabSize;
|
||||
EDITOR(setTabStopDistance(width));
|
||||
}
|
||||
|
||||
void FakeVimHandler::Private::restoreWidget(int tabSize)
|
||||
{
|
||||
//EDITOR(removeEventFilter(q));
|
||||
//EDITOR(setReadOnly(m_wasReadOnly));
|
||||
const int charWidth = QFontMetrics(EDITOR(font())).horizontalAdvance(' ');
|
||||
EDITOR(setTabStopWidth(charWidth * tabSize));
|
||||
setTabSize(tabSize);
|
||||
g.visualMode = NoVisualMode;
|
||||
// Force "ordinary" cursor.
|
||||
setThinCursor();
|
||||
|
Reference in New Issue
Block a user