[LyX/master] Open double-space auto correction to other systems
Koji Yokota <[email protected]> Fri, 24 Apr 2026 02:56:51 +0000
| Newsgroups | gmane.editors.lyx.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit a0188eff79d760bd1f18b8301197cab70e43d5bc Author: Koji Yokota <[email protected]> Date: Fri Apr 24 11:56:07 2026 +0900 Open double-space auto correction to other systems Make correction in 9fa59bdfe5f6 available to other systems than macOS --- src/frontends/qt/GuiWorkArea.cpp | 6 ++---- src/frontends/qt/GuiWorkArea_Private.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index 08a223bb03..e3f3304b5e 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -674,19 +674,18 @@ bool GuiWorkArea::event(QEvent * e) keyPressEvent(ke); return true; } -#ifdef Q_OS_MACOS // see "case QEvent::InputMethod:" below if (ke->key() == Qt::Key_Space) d->prev_space_key_ = true; else d->prev_space_key_ = false; -#endif + return QAbstractScrollArea::event(e); } case QEvent::InputMethod: { QInputMethodEvent * ev = static_cast<QInputMethodEvent*>(e); -#ifdef Q_OS_MACOS + // Hitting double spaces turns the second space into an input method // commit string "a period plus a space" in the default English keyboard // if this feature is turned on in the system settings. @@ -701,7 +700,6 @@ bool GuiWorkArea::event(QEvent * e) lyx::dispatch(FuncRequest(LFUN_CHAR_DELETE_BACKWARD)); d->prev_space_key_ = false; } -#endif inputMethodEvent(ev); return e->isAccepted(); } diff --git a/src/frontends/qt/GuiWorkArea_Private.h b/src/frontends/qt/GuiWorkArea_Private.h index 105603757a..e82e4d6e8e 100644 --- a/src/frontends/qt/GuiWorkArea_Private.h +++ b/src/frontends/qt/GuiWorkArea_Private.h @@ -156,12 +156,10 @@ struct GuiWorkArea::Private QTransform item_trans_; /// whether item_rect_ and item_trans need to be reset bool item_geom_needs_reset_ = false; -#ifdef Q_OS_MACOS /// whether previously input key was a spacekey bool prev_space_key_ = false; /// the replacement string that macOS sends when double spaces are hit QString const auto_replacement_str_ = ". "; -#endif /// for debug //QLocale::Language im_lang_ = QLocale::AnyLanguage; -- lyx-cvs mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-cvs