Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
This commit is contained in:
commit
daaa97ba76
|
@ -57,6 +57,8 @@
|
|||
|
||||
QHash<ParserLanguage,std::weak_ptr<CppParser>> Editor::mSharedParsers;
|
||||
|
||||
int Editor::mShouldDisableSuggestionInInputMethodEvent = -1;
|
||||
|
||||
Editor::Editor(QWidget *parent):
|
||||
Editor(parent,"untitled",ENCODING_AUTO_DETECT,nullptr,true,nullptr)
|
||||
{
|
||||
|
@ -1339,6 +1341,20 @@ void Editor::mouseReleaseEvent(QMouseEvent *event)
|
|||
void Editor::inputMethodEvent(QInputMethodEvent *event)
|
||||
{
|
||||
QSynedit::QSynEdit::inputMethodEvent(event);
|
||||
#ifdef Q_OS_UNIX
|
||||
if (mShouldDisableSuggestionInInputMethodEvent == -1) {
|
||||
//not inited
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
//input method is ibus, disable suggestion
|
||||
mShouldDisableSuggestionInInputMethodEvent =
|
||||
(env.value("QT_IM_MODULE")=="ibus" )? 1 : 0;
|
||||
}
|
||||
if (mShouldDisableSuggestionInInputMethodEvent == 1) {
|
||||
if (pMainWindow->completionPopup()->isVisible())
|
||||
pMainWindow->completionPopup()->close();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
QString s = event->commitString();
|
||||
if (s.isEmpty())
|
||||
return;
|
||||
|
|
|
@ -355,6 +355,9 @@ private:
|
|||
QMap<QString,StatementKind> mIdentCache;
|
||||
|
||||
static QHash<ParserLanguage,std::weak_ptr<CppParser>> mSharedParsers;
|
||||
#ifdef Q_OS_UNIX
|
||||
static int mShouldDisableSuggestionInInputMethodEvent;
|
||||
#endif
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue