diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 5c7fc40a10..402b18b9c1 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -17,6 +17,7 @@ #include "GuiView.h" #include "GuiWorkArea.h" #include "qt_helpers.h" +#include "Language.h" #include "buffer_funcs.h" #include "BufferParams.h" @@ -529,6 +530,12 @@ void FindAndReplaceWidget::showEvent(QShowEvent * /* ev */) LYXERR(Debug::FIND, "Applying document params to replace buffer"); ApplyParams(replace_buf, doc_bp); + string lang = doc_bp.language->lang(); + LYXERR(Debug::FIND, "Setting current editing language to " << lang << endl); + FuncRequest cmd(LFUN_LANGUAGE, lang); + find_buf.text().dispatch(find_work_area_->bufferView().cursor(), cmd); + replace_buf.text().dispatch(replace_work_area_->bufferView().cursor(), cmd); + view_.setCurrentWorkArea(find_work_area_); LYXERR(Debug::FIND, "Selecting entire find buffer"); dispatch(FuncRequest(LFUN_BUFFER_BEGIN));