Commit 4af07680 authored by hjk's avatar hjk
Browse files

restore overwrite mode hack.

cursor looks better at the end of a line this way...
parent d4f4f508
...@@ -157,7 +157,10 @@ void FakeVimPlugin::installHandler() ...@@ -157,7 +157,10 @@ void FakeVimPlugin::installHandler()
return; return;
plainTextEdit->removeEventFilter(m_handler); plainTextEdit->removeEventFilter(m_handler);
plainTextEdit->installEventFilter(m_handler); plainTextEdit->installEventFilter(m_handler);
plainTextEdit->setOverwriteMode(true); QFont font = plainTextEdit->font();
//font.setFamily("Monospace");
m_savedCursorWidth = plainTextEdit->cursorWidth();
plainTextEdit->setCursorWidth(QFontMetrics(font).width(QChar('x')));
//QMainWindow mw; //QMainWindow mw;
connect(m_handler, SIGNAL(commandBufferChanged(QString)), connect(m_handler, SIGNAL(commandBufferChanged(QString)),
...@@ -172,7 +175,7 @@ void FakeVimPlugin::removeHandler(QObject *ob) ...@@ -172,7 +175,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(ob); QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(ob);
if (!plainTextEdit) if (!plainTextEdit)
return; return;
plainTextEdit->setOverwriteMode(false); plainTextEdit->setCursorWidth(m_savedCursorWidth);
} }
void FakeVimPlugin::showCommandBuffer(const QString &contents) void FakeVimPlugin::showCommandBuffer(const QString &contents)
......
...@@ -74,6 +74,7 @@ private: ...@@ -74,6 +74,7 @@ private:
FakeVimHandler *m_handler; FakeVimHandler *m_handler;
ExtensionSystem::PluginManager *m_pm; ExtensionSystem::PluginManager *m_pm;
QAction *m_installHandlerAction; QAction *m_installHandlerAction;
int m_savedCursorWidth;
}; };
} // namespace Internal } // 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