Commit 93c60417 authored by hjk's avatar hjk
Browse files

use QTextEdit's "overwriteMode" instead of playing around with the

cursor width manually.
parent 00a3b537
......@@ -157,10 +157,7 @@ void FakeVimPlugin::installHandler()
return;
plainTextEdit->removeEventFilter(m_handler);
plainTextEdit->installEventFilter(m_handler);
QFont font = plainTextEdit->font();
//font.setFamily("Monospace");
m_savedCursorWidth = plainTextEdit->cursorWidth();
plainTextEdit->setCursorWidth(QFontMetrics(font).width(QChar('x')));
plainTextEdit->setOverwriteMode(true);
//QMainWindow mw;
connect(m_handler, SIGNAL(commandBufferChanged(QString)),
......@@ -175,7 +172,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(ob);
if (!plainTextEdit)
return;
plainTextEdit->setCursorWidth(m_savedCursorWidth);
plainTextEdit->setOverwriteMode(false);
}
void FakeVimPlugin::showCommandBuffer(const QString &contents)
......
......@@ -74,7 +74,6 @@ private:
FakeVimHandler *m_handler;
ExtensionSystem::PluginManager *m_pm;
QAction *m_installHandlerAction;
int m_savedCursorWidth;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment