forked from qt-creator/qt-creator
Make ":w" work in fakevim without needing a filename to be specified when file is not new.
Unfortunately, the "this file has been edited outside of Qt Creator" dialog pops up.
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#include "fakevimconstants.h"
|
#include "fakevimconstants.h"
|
||||||
|
|
||||||
|
#include <texteditor/basetexteditor.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
@@ -1485,6 +1487,9 @@ void FakeVimHandler::Private::setWidget(QWidget *ob)
|
|||||||
{
|
{
|
||||||
m_textedit = qobject_cast<QTextEdit *>(ob);
|
m_textedit = qobject_cast<QTextEdit *>(ob);
|
||||||
m_plaintextedit = qobject_cast<QPlainTextEdit *>(ob);
|
m_plaintextedit = qobject_cast<QPlainTextEdit *>(ob);
|
||||||
|
TextEditor::BaseTextEditor* editor = qobject_cast<TextEditor::BaseTextEditor*>(ob);
|
||||||
|
if (editor)
|
||||||
|
m_currentFileName = editor->file()->fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user